final class FloatArrayList extends AbstractProtobufList<java.lang.Float> implements Internal.FloatList, java.util.RandomAccess, PrimitiveNonBoxingCollection
Internal.FloatList
on top of a primitive array.Modifier and Type | Field and Description |
---|---|
private float[] |
array
The backing store for the list.
|
private static FloatArrayList |
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) |
FloatArrayList()
Constructs a new mutable
FloatArrayList with default capacity. |
private |
FloatArrayList(float[] other,
int size)
Constructs a new mutable
FloatArrayList
containing the same elements as other . |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
java.lang.Float element) |
boolean |
addAll(java.util.Collection<? extends java.lang.Float> collection) |
void |
addFloat(float element)
Like
#add(Float) but more efficient in that it doesn't box the element. |
private void |
addFloat(int index,
float element)
Like
add(int, Float) but more efficient in that it doesn't box the element. |
static FloatArrayList |
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.Float |
get(int index) |
float |
getFloat(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.FloatList |
mutableCopyWithCapacity(int capacity)
Returns a mutable clone of this list with the specified capacity.
|
java.lang.Float |
remove(int index) |
boolean |
remove(java.lang.Object o) |
java.lang.Float |
set(int index,
java.lang.Float element) |
float |
setFloat(int index,
float 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, retainAll
indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
contains, containsAll, isEmpty, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isModifiable, makeImmutable
private static final FloatArrayList EMPTY_LIST
private float[] array
private int size
FloatArrayList()
FloatArrayList
with default capacity.private FloatArrayList(float[] other, int size)
FloatArrayList
containing the same elements as other
.public static FloatArrayList emptyList()
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection<java.lang.Float>
equals
in interface java.util.List<java.lang.Float>
equals
in class AbstractProtobufList<java.lang.Float>
public int hashCode()
hashCode
in interface java.util.Collection<java.lang.Float>
hashCode
in interface java.util.List<java.lang.Float>
hashCode
in class AbstractProtobufList<java.lang.Float>
public Internal.FloatList mutableCopyWithCapacity(int capacity)
Internal.FloatList
mutableCopyWithCapacity
in interface Internal.FloatList
mutableCopyWithCapacity
in interface Internal.ProtobufList<java.lang.Float>
public java.lang.Float get(int index)
get
in interface java.util.List<java.lang.Float>
get
in class java.util.AbstractList<java.lang.Float>
public float getFloat(int index)
Internal.FloatList
List.get(int)
but more efficient in that it doesn't box the returned value.getFloat
in interface Internal.FloatList
public int size()
size
in interface java.util.Collection<java.lang.Float>
size
in interface java.util.List<java.lang.Float>
size
in class java.util.AbstractCollection<java.lang.Float>
public java.lang.Float set(int index, java.lang.Float element)
set
in interface java.util.List<java.lang.Float>
set
in class AbstractProtobufList<java.lang.Float>
public float setFloat(int index, float element)
Internal.FloatList
List.set(int, Object)
but more efficient in that it doesn't box the element.setFloat
in interface Internal.FloatList
public void add(int index, java.lang.Float element)
add
in interface java.util.List<java.lang.Float>
add
in class AbstractProtobufList<java.lang.Float>
public void addFloat(float element)
#add(Float)
but more efficient in that it doesn't box the element.addFloat
in interface Internal.FloatList
private void addFloat(int index, float element)
add(int, Float)
but more efficient in that it doesn't box the element.public boolean addAll(java.util.Collection<? extends java.lang.Float> collection)
addAll
in interface java.util.Collection<java.lang.Float>
addAll
in interface java.util.List<java.lang.Float>
addAll
in class AbstractProtobufList<java.lang.Float>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<java.lang.Float>
remove
in interface java.util.List<java.lang.Float>
remove
in class AbstractProtobufList<java.lang.Float>
public java.lang.Float remove(int index)
remove
in interface java.util.List<java.lang.Float>
remove
in class AbstractProtobufList<java.lang.Float>
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)