final class DoubleArrayList extends AbstractProtobufList<java.lang.Double> implements Internal.DoubleList, java.util.RandomAccess, PrimitiveNonBoxingCollection
Internal.DoubleList on top of a primitive array.| Modifier and Type | Field and Description |
|---|---|
private double[] |
array
The backing store for the list.
|
private static DoubleArrayList |
EMPTY_LIST |
private int |
size
The size of the list distinct from the length of the array.
|
DEFAULT_CAPACITY| Modifier | Constructor and Description |
|---|---|
(package private) |
DoubleArrayList()
Constructs a new mutable
DoubleArrayList with default capacity. |
private |
DoubleArrayList(double[] other,
int size)
Constructs a new mutable
DoubleArrayList
containing the same elements as other. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
java.lang.Double element) |
boolean |
addAll(java.util.Collection<? extends java.lang.Double> collection) |
void |
addDouble(double element)
Like
#add(Double) but more efficient in that it doesn't box the element. |
private void |
addDouble(int index,
double element)
Like
add(int, Double) but more efficient in that it doesn't box the element. |
static DoubleArrayList |
emptyList() |
private void |
ensureIndexInRange(int index)
Ensures that the provided
index is within the range of [0, size]. |
boolean |
equals(java.lang.Object o) |
java.lang.Double |
get(int index) |
double |
getDouble(int index)
Like
List.get(int) but more efficient in that it doesn't box the returned value. |
int |
hashCode() |
private java.lang.String |
makeOutOfBoundsExceptionMessage(int index) |
Internal.DoubleList |
mutableCopyWithCapacity(int capacity)
Returns a mutable clone of this list with the specified capacity.
|
java.lang.Double |
remove(int index) |
boolean |
remove(java.lang.Object o) |
protected void |
removeRange(int fromIndex,
int toIndex) |
java.lang.Double |
set(int index,
java.lang.Double element) |
double |
setDouble(int index,
double element)
Like
List.set(int, Object) but more efficient in that it doesn't box the element. |
int |
size() |
add, addAll, clear, ensureIsMutable, isModifiable, makeImmutable, removeAll, retainAllindexOf, iterator, lastIndexOf, listIterator, listIterator, subListcontains, containsAll, isEmpty, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisModifiable, makeImmutableprivate static final DoubleArrayList EMPTY_LIST
private double[] array
private int size
DoubleArrayList()
DoubleArrayList with default capacity.private DoubleArrayList(double[] other,
int size)
DoubleArrayList
containing the same elements as other.public static DoubleArrayList emptyList()
protected void removeRange(int fromIndex,
int toIndex)
removeRange in class java.util.AbstractList<java.lang.Double>public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<java.lang.Double>equals in interface java.util.List<java.lang.Double>equals in class AbstractProtobufList<java.lang.Double>public int hashCode()
hashCode in interface java.util.Collection<java.lang.Double>hashCode in interface java.util.List<java.lang.Double>hashCode in class AbstractProtobufList<java.lang.Double>public Internal.DoubleList mutableCopyWithCapacity(int capacity)
Internal.DoubleListmutableCopyWithCapacity in interface Internal.DoubleListmutableCopyWithCapacity in interface Internal.ProtobufList<java.lang.Double>public java.lang.Double get(int index)
get in interface java.util.List<java.lang.Double>get in class java.util.AbstractList<java.lang.Double>public double getDouble(int index)
Internal.DoubleListList.get(int) but more efficient in that it doesn't box the returned value.getDouble in interface Internal.DoubleListpublic int size()
size in interface java.util.Collection<java.lang.Double>size in interface java.util.List<java.lang.Double>size in class java.util.AbstractCollection<java.lang.Double>public java.lang.Double set(int index,
java.lang.Double element)
set in interface java.util.List<java.lang.Double>set in class AbstractProtobufList<java.lang.Double>public double setDouble(int index,
double element)
Internal.DoubleListList.set(int, Object) but more efficient in that it doesn't box the element.setDouble in interface Internal.DoubleListpublic void add(int index,
java.lang.Double element)
add in interface java.util.List<java.lang.Double>add in class AbstractProtobufList<java.lang.Double>public void addDouble(double element)
#add(Double) but more efficient in that it doesn't box the element.addDouble in interface Internal.DoubleListprivate void addDouble(int index,
double element)
add(int, Double) but more efficient in that it doesn't box the element.public boolean addAll(java.util.Collection<? extends java.lang.Double> collection)
addAll in interface java.util.Collection<java.lang.Double>addAll in interface java.util.List<java.lang.Double>addAll in class AbstractProtobufList<java.lang.Double>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<java.lang.Double>remove in interface java.util.List<java.lang.Double>remove in class AbstractProtobufList<java.lang.Double>public java.lang.Double remove(int index)
remove in interface java.util.List<java.lang.Double>remove in class AbstractProtobufList<java.lang.Double>private void ensureIndexInRange(int index)
index is within the range of [0, size]. Throws an
IndexOutOfBoundsException if it is not.index - the index to verify is in rangeprivate java.lang.String makeOutOfBoundsExceptionMessage(int index)