DoubleList on top of a primitive array.
| Modifier and Type | Field and Description |
|---|---|
| private double[] | array
The backing store for the list. |
| private static final DoubleArrayList | |
| private int | size
The size of the list distinct from the length of the array. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| private | DoubleArrayList(double[] other, int size)
Constructs a new mutable |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(int
index at which the specified element is to be inserted index, Double element to be inserted element)Overrides com. Implements java. |
| public boolean | addAll(Collection<? extends Double>
collection containing elements to be added to this list collection)Overrides com. Implements java. |
| public void | addDouble(double element)
Implements com. add(Double) but more efficient in that it doesn't box the element.
|
| private void | addDouble(int index, double element)
Like |
| public static DoubleArrayList | |
| private void | ensureIndexInRange(int
the index to verify is in range index)Ensures that the provided |
| public boolean | equals(Object
the object to be compared for equality with this list o)Overrides com. Implements java. |
| public Double | get(int
index of the element to return index)Implements abstract java. Implements java. |
| public double | getDouble(int index)
Implements com. get(int) but more efficient in that it doesn't box the returned value.
|
| public int | hashCode()
Overrides com. Implements java. |
| private String | |
| public Internal. | mutableCopyWithCapacity(int capacity)
Implements com. |
| public boolean | remove(Object
element to be removed from this list, if present o)Overrides com. Implements java. |
| public Double | remove(int
the index of the element to be removed index)Overrides com. Implements java. |
| protected void | removeRange(int
index of first element to be removed fromIndex, int index after last element to be removed toIndex)Overrides java. fromIndex, inclusive, and toIndex, exclusive.
|
| public Double | set(int
index of the element to replace index, Double element to be stored at the specified position element)Overrides com. Implements java. |
| public double | setDouble(int index, double element)
Implements com. set(int, Object) but more efficient in that it doesn't box the element.
|
| public int | size()
Implements abstract java. Implements java. |
| array | back to summary |
|---|---|
| private double[] array The backing store for the list. | |
| EMPTY_LIST | back to summary |
|---|---|
| private static final DoubleArrayList EMPTY_LIST | |
| size | back to summary |
|---|---|
| private int size The size of the list distinct from the length of the array. That is, it is the number of elements set in the list. | |
| DoubleArrayList | back to summary |
|---|---|
| pack-priv DoubleArrayList() Constructs a new mutable | |
| DoubleArrayList | back to summary |
|---|---|
| private DoubleArrayList(double[] other, int size) Constructs a new mutable | |
| add | back to summary |
|---|---|
| public void add(int index, Double element) Overrides com. Implements java. Doc from java. Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). | |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends Double> collection) Overrides com. Implements java. Doc from java. Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
| |
| addDouble | back to summary |
|---|---|
| public void addDouble(double element) Implements com. Like
| |
| addDouble | back to summary |
|---|---|
| private void addDouble(int index, double element) Like | |
| emptyList | back to summary |
|---|---|
| public static DoubleArrayList emptyList() | |
| ensureIndexInRange | back to summary |
|---|---|
| private void ensureIndexInRange(int index) Ensures that the provided
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides com. Implements java. Doc from java. Compares the specified object with this list for equality. Returns
| |
| get | back to summary |
|---|---|
| public Double get(int index) Implements abstract java. Implements java. Doc from java. Returns the element at the specified position in this list. | |
| getDouble | back to summary |
|---|---|
| public double getDouble(int index) Implements com. Doc from com. Like
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides com. Implements java. Doc from java. Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
This ensures that list1.equals(list2) implies that
list1.hashCode()==list2.hashCode() for any two lists,
list1 and list2, as required by the general
contract of Object#hashCode.
| |
| makeOutOfBoundsExceptionMessage | back to summary |
|---|---|
| private String makeOutOfBoundsExceptionMessage(int index) | |
| mutableCopyWithCapacity | back to summary |
|---|---|
| public Internal. Implements com. Doc from com. Returns a mutable clone of this list with the specified capacity.
| |
| remove | back to summary |
|---|---|
| public boolean remove(Object o) Overrides com. Implements java. Doc from java. Removes the first occurrence of the specified element from this list,
if it is present (optional operation). If this list does not contain
the element, it is unchanged. More formally, removes the element with
the lowest index | |
| remove | back to summary |
|---|---|
| public Double remove(int index) Overrides com. Implements java. Doc from java. Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list. | |
| removeRange | back to summary |
|---|---|
| protected void removeRange(int fromIndex, int toIndex) Overrides java. Doc from java. Removes from this list all of the elements whose index is between
This method is called by the
| |
| set | back to summary |
|---|---|
| public Double set(int index, Double element) Overrides com. Implements java. Doc from java. Replaces the element at the specified position in this list with the specified element (optional operation). | |
| setDouble | back to summary |
|---|---|
| public double setDouble(int index, double element) Implements com. Doc from com. Like
| |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than
| |