| java.lang.Object org.apache.commons.collections.primitives.AbstractDoubleCollection org.apache.commons.collections.primitives.RandomAccessDoubleList org.apache.commons.collections.primitives.ArrayDoubleList
ArrayDoubleList | public class ArrayDoubleList extends RandomAccessDoubleList implements DoubleList,Serializable(Code) | | An
DoubleList backed by an array of double 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 | ArrayDoubleList() Construct an empty list with the default
initial capacity. | public | ArrayDoubleList(int initialCapacity) Construct an empty list with the given
initial capacity. | public | ArrayDoubleList(DoubleCollection 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, double 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 double | get(int index) | public double | removeElementAt(int index) Removes the element at the specified position in
(optional operation). | public double | set(int index, double 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
ArrayDoubleList.size size . |
ArrayDoubleList | public ArrayDoubleList()(Code) | | Construct an empty list with the default
initial capacity.
|
ArrayDoubleList | public ArrayDoubleList(int initialCapacity)(Code) | | Construct an empty list with the given
initial capacity.
throws: IllegalArgumentException - when initialCapacity is negative |
add | public void add(int index, double 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 double get(int index)(Code) | | |
removeElementAt | public double 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 double set(int index, double 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 |
|
|