| java.lang.Object org.apache.commons.collections.primitives.AbstractShortCollection org.apache.commons.collections.primitives.RandomAccessShortList org.apache.commons.collections.primitives.ArrayShortList
ArrayShortList | public class ArrayShortList extends RandomAccessShortList implements ShortList,Serializable(Code) | | An
ShortList backed by an array of short s.
This implementation supports all optional methods.
since: Commons Primitives 1.0 version: $Revision: 1.3 $ $Date: 2003/10/16 20:49:36 $ author: Rodney Waldhoff |
Constructor Summary | |
public | ArrayShortList() Construct an empty list with the default
initial capacity. | public | ArrayShortList(int initialCapacity) Construct an empty list with the given
initial capacity. | public | ArrayShortList(ShortCollection that) Constructs a list containing the elements of the given collection,
in the order they are returned by that collection's iterator. |
Method Summary | |
public void | add(int index, short element) Inserts the specified element at the specified position
(optional operation). | public void | ensureCapacity(int mincap) Increases my capacity, if necessary, to ensure that I can hold at
least the number of elements specified by the minimum capacity
argument without growing. | public short | get(int index) | public short | removeElementAt(int index) Removes the element at the specified position in
(optional operation). | public short | set(int index, short element) Replaces the element at the specified
position in me with the specified element
(optional operation). | public int | size() | public void | trimToSize() Reduce my capacity, if necessary, to match my
current
ArrayShortList.size size . |
ArrayShortList | public ArrayShortList()(Code) | | Construct an empty list with the default
initial capacity.
|
ArrayShortList | public ArrayShortList(int initialCapacity)(Code) | | Construct an empty list with the given
initial capacity.
throws: IllegalArgumentException - when initialCapacity is negative |
add | public void add(int index, short element)(Code) | | Inserts the specified element at the specified position
(optional operation). Shifts the element currently
at that position (if any) and any subsequent elements to the
right, increasing their indices.
Parameters: index - the index at which to insert the element Parameters: element - the value to insert throws: UnsupportedOperationException - when this operation is not supported throws: IllegalArgumentException - if some aspect of the specified element prevents it from being added to me throws: IndexOutOfBoundsException - if the specified index is out of range |
ensureCapacity | public void ensureCapacity(int mincap)(Code) | | Increases my capacity, if necessary, to ensure that I can hold at
least the number of elements specified by the minimum capacity
argument without growing.
|
get | public short get(int index)(Code) | | |
removeElementAt | public short removeElementAt(int index)(Code) | | Removes the element at the specified position in
(optional operation). Any subsequent elements
are shifted to the left, subtracting one from their
indices. Returns the element that was removed.
Parameters: index - the index of the element to remove the value of the element that was removed throws: UnsupportedOperationException - when this operation is not supported throws: IndexOutOfBoundsException - if the specified index is out of range |
set | public short set(int index, short element)(Code) | | Replaces the element at the specified
position in me with the specified element
(optional operation).
Parameters: index - the index of the element to change Parameters: element - the value to be stored at the specified position the value previously stored at the specified position throws: UnsupportedOperationException - when this operation is not supported throws: IndexOutOfBoundsException - if the specified index is out of range |
|
|