ch.bfh.algo.core.sequence
Class PositionArray<E,P extends GenericArrayPosition<E,P>>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<P>
          extended by ch.bfh.algo.core.sequence.PositionArray<E,P>
All Implemented Interfaces:
Iterable<P>, Collection<P>, List<P>

public class PositionArray<E,P extends GenericArrayPosition<E,P>>
extends AbstractList<P>


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PositionArray(int size, ArrayStrategy<P> factory)
           
 
Method Summary
 P delete(int index)
           
 P get(int index)
           
 void insert(int index, P position)
           
 int size()
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

PositionArray

public PositionArray(int size,
                     ArrayStrategy<P> factory)
Method Detail

get

public P get(int index)
                                        throws IndexOutOfBoundsException
Specified by:
get in interface List<P extends GenericArrayPosition<E,P>>
Specified by:
get in class AbstractList<P extends GenericArrayPosition<E,P>>
Throws:
IndexOutOfBoundsException

size

public int size()
Specified by:
size in interface Collection<P extends GenericArrayPosition<E,P>>
Specified by:
size in interface List<P extends GenericArrayPosition<E,P>>
Specified by:
size in class AbstractCollection<P extends GenericArrayPosition<E,P>>

insert

public void insert(int index,
                   P position)
            throws IndexOutOfBoundsException
Throws:
IndexOutOfBoundsException

delete

public P delete(int index)
                                           throws IndexOutOfBoundsException
Throws:
IndexOutOfBoundsException