| java.lang.Object org.apache.commons.collections.primitives.AbstractCharCollection org.apache.commons.collections.primitives.RandomAccessCharList org.apache.commons.collections.primitives.ArrayCharList
ArrayCharList | public class ArrayCharList extends RandomAccessCharList implements CharList,Serializable(Code) | | An
CharList backed by an array of char s.
This implementation supports all optional methods.
since: Commons Primitives 1.0 version: $Revision: 1.3 $ $Date: 2003/10/16 20:49:35 $ author: Rodney Waldhoff |
Constructor Summary | |
public | ArrayCharList() Construct an empty list with the default
initial capacity. | public | ArrayCharList(int initialCapacity) Construct an empty list with the given
initial capacity. | public | ArrayCharList(CharCollection 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, char 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 char | get(int index) | public char | removeElementAt(int index) Removes the element at the specified position in
(optional operation). | public char | set(int index, char 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
ArrayCharList.size size . |
ArrayCharList | public ArrayCharList()(Code) | | Construct an empty list with the default
initial capacity.
|
ArrayCharList | public ArrayCharList(int initialCapacity)(Code) | | Construct an empty list with the given
initial capacity.
throws: IllegalArgumentException - when initialCapacity is negative |
add | public void add(int index, char 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 char get(int index)(Code) | | |
removeElementAt | public char 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 char set(int index, char 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 |
trimToSize | public void trimToSize()(Code) | | Reduce my capacity, if necessary, to match my
current
ArrayCharList.size size .
|
|
|