org.ka2ddo.util
Class ArrayBlockList<V>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<V>
              extended by org.ka2ddo.util.ArrayBlockList<V>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<V>, java.util.Collection<V>, java.util.List<V>, java.util.RandomAccess

public class ArrayBlockList<V>
extends java.util.ArrayList<V>

This is an extension to the JRE's java.util.ArrayList with the ability to do block removes exposed for public use.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ArrayBlockList()
          Constructs an empty list with an initial capacity of ten.
ArrayBlockList(java.util.Collection<? extends V> c)
          Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
ArrayBlockList(int initialCapacity)
          Constructs an empty list with the specified initial capacity.
 
Method Summary
 void removeRange(int fromIndex, int toIndex)
          Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

ArrayBlockList

public ArrayBlockList(int initialCapacity)
Constructs an empty list with the specified initial capacity.

Parameters:
initialCapacity - the initial capacity of the list
Throws:
java.lang.IllegalArgumentException - if the specified initial capacity is negative

ArrayBlockList

public ArrayBlockList()
Constructs an empty list with an initial capacity of ten.


ArrayBlockList

public ArrayBlockList(java.util.Collection<? extends V> c)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.

Parameters:
c - the collection whose elements are to be placed into this list
Throws:
java.lang.NullPointerException - if the specified collection is null
Method Detail

removeRange

public void removeRange(int fromIndex,
                        int toIndex)
Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)

Overrides:
removeRange in class java.util.ArrayList<V>
Parameters:
fromIndex - index of first element to be removed
toIndex - index after last element to be removed
Throws:
java.lang.IndexOutOfBoundsException - if fromIndex or toIndex out of range (fromIndex < 0 || fromIndex >= size() || toIndex > size() || toIndex < fromIndex)