net.sf.molae.pipe.genimpl
Class IndexedList<E>
java.lang.Object
   java.util.AbstractCollection<E>
java.util.AbstractCollection<E>
       java.util.AbstractList<E>
java.util.AbstractList<E>
           net.sf.molae.pipe.genimpl.IndexedList<E>
net.sf.molae.pipe.genimpl.IndexedList<E>
- All Implemented Interfaces: 
- Iterable<E>, Collection<E>, List<E>
- public class IndexedList<E> 
- extends AbstractList<E>
A list with an index to its entries.
 This list is performant for fixed-size lists.
 add and remove should not be used.
 Duplicate entries are allowed.
- Since:
- 1.1
 
 
| Constructor Summary | 
| IndexedList(List<E> base)Constructs an indexed list object.
 | 
 
 
 
 
 
 
IndexedList
public IndexedList(List<E> base)
- Constructs an indexed list object.
 
- Parameters:
- base- the base list containing the list entries
 
getPositions
public Map<E,Integer> getPositions()
- Returns the positions map.
 
- 
- Returns:
- the positions map.
 
recalculatePositions
protected void recalculatePositions()
- Recalculates the index map.
 
- 
 
putPosition
protected void putPosition(int index,
                           E element)
- Checks if the specified element is a new element in the list or
 at the first position and changes the position map accordingly.
 
- 
- Parameters:
- index- index of new element
- element- newly entered element
 
size
public int size()
- 
- Specified by:
- sizein interface- Collection<E>
- Specified by:
- sizein interface- List<E>
- Specified by:
- sizein class- AbstractCollection<E>
 
- 
 
contains
public boolean contains(Object o)
- 
- Specified by:
- containsin interface- Collection<E>
- Specified by:
- containsin interface- List<E>
- Overrides:
- containsin class- AbstractCollection<E>
 
- 
 
add
public boolean add(E o)
- 
- Specified by:
- addin interface- Collection<E>
- Specified by:
- addin interface- List<E>
- Overrides:
- addin class- AbstractList<E>
 
- 
 
remove
public boolean remove(Object o)
- 
- Specified by:
- removein interface- Collection<E>
- Specified by:
- removein interface- List<E>
- Overrides:
- removein class- AbstractCollection<E>
 
- 
 
clear
public void clear()
- 
- Specified by:
- clearin interface- Collection<E>
- Specified by:
- clearin interface- List<E>
- Overrides:
- clearin class- AbstractList<E>
 
- 
 
get
public E get(int index)
- 
- Specified by:
- getin interface- List<E>
- Specified by:
- getin class- AbstractList<E>
 
- 
 
set
public E set(int index,
             E element)
- 
- Specified by:
- setin interface- List<E>
- Overrides:
- setin class- AbstractList<E>
 
- 
 
add
public void add(int index,
                E element)
- 
- Specified by:
- addin interface- List<E>
- Overrides:
- addin class- AbstractList<E>
 
- 
 
remove
public E remove(int index)
- 
- Specified by:
- removein interface- List<E>
- Overrides:
- removein class- AbstractList<E>
 
- 
 
indexOf
public int indexOf(Object o)
- 
- Specified by:
- indexOfin interface- List<E>
- Overrides:
- indexOfin class- AbstractList<E>
 
-