org.scijava.util
Class SizableArrayList<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<E>
              extended by org.scijava.util.SizableArrayList<E>
Type Parameters:
E - The type of data stored in the list.
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, Sizable

public class SizableArrayList<E>
extends ArrayList<E>
implements Sizable

An ArrayList whose size can be adjusted more efficiently.

When sizing down, elements at the end of the list are removed in one operation. When sizing up, null elements are appended to the list.

Author:
Curtis Rueden
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SizableArrayList()
           
SizableArrayList(Collection<? extends E> c)
           
SizableArrayList(int initialCapacity)
           
 
Method Summary
 void ensureCapacity(int capacity)
           
 void setSize(int size)
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, 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 org.scijava.util.Sizable
size
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

SizableArrayList

public SizableArrayList(int initialCapacity)

SizableArrayList

public SizableArrayList()

SizableArrayList

public SizableArrayList(Collection<? extends E> c)
Method Detail

ensureCapacity

public void ensureCapacity(int capacity)
Overrides:
ensureCapacity in class ArrayList<E>

setSize

public void setSize(int size)
Specified by:
setSize in interface Sizable


Copyright © 2009–2014 SciJava. All rights reserved.