final class IntArrayList extends AbstractProtobufList<java.lang.Integer> implements Internal.IntList, java.util.RandomAccess, PrimitiveNonBoxingCollection
Internal.IntList on top of a primitive array.| Modifier and Type | Field and Description |
|---|---|
private int[] |
array
The backing store for the list.
|
private static IntArrayList |
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) |
IntArrayList()
Constructs a new mutable
IntArrayList with default capacity. |
private |
IntArrayList(int[] other,
int size)
Constructs a new mutable
IntArrayList
containing the same elements as other. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
java.lang.Integer element) |
boolean |
addAll(java.util.Collection<? extends java.lang.Integer> collection) |
void |
addInt(int element)
Like
#add(Integer) but more efficient in that it doesn't box the element. |
private void |
addInt(int index,
int element)
Like
add(int, Integer) but more efficient in that it doesn't box the element. |
static IntArrayList |
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.Integer |
get(int index) |
int |
getInt(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.IntList |
mutableCopyWithCapacity(int capacity)
Returns a mutable clone of this list with the specified capacity.
|
java.lang.Integer |
remove(int index) |
boolean |
remove(java.lang.Object o) |
protected void |
removeRange(int fromIndex,
int toIndex) |
java.lang.Integer |
set(int index,
java.lang.Integer element) |
int |
setInt(int index,
int 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 IntArrayList EMPTY_LIST
private int[] array
private int size
IntArrayList()
IntArrayList with default capacity.private IntArrayList(int[] other,
int size)
IntArrayList
containing the same elements as other.public static IntArrayList emptyList()
protected void removeRange(int fromIndex,
int toIndex)
removeRange in class java.util.AbstractList<java.lang.Integer>public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<java.lang.Integer>equals in interface java.util.List<java.lang.Integer>equals in class AbstractProtobufList<java.lang.Integer>public int hashCode()
hashCode in interface java.util.Collection<java.lang.Integer>hashCode in interface java.util.List<java.lang.Integer>hashCode in class AbstractProtobufList<java.lang.Integer>public Internal.IntList mutableCopyWithCapacity(int capacity)
Internal.IntListmutableCopyWithCapacity in interface Internal.IntListmutableCopyWithCapacity in interface Internal.ProtobufList<java.lang.Integer>public java.lang.Integer get(int index)
get in interface java.util.List<java.lang.Integer>get in class java.util.AbstractList<java.lang.Integer>public int getInt(int index)
Internal.IntListList.get(int) but more efficient in that it doesn't box the returned value.getInt in interface Internal.IntListpublic int size()
size in interface java.util.Collection<java.lang.Integer>size in interface java.util.List<java.lang.Integer>size in class java.util.AbstractCollection<java.lang.Integer>public java.lang.Integer set(int index,
java.lang.Integer element)
set in interface java.util.List<java.lang.Integer>set in class AbstractProtobufList<java.lang.Integer>public int setInt(int index,
int element)
Internal.IntListList.set(int, Object) but more efficient in that it doesn't box the element.setInt in interface Internal.IntListpublic void add(int index,
java.lang.Integer element)
add in interface java.util.List<java.lang.Integer>add in class AbstractProtobufList<java.lang.Integer>public void addInt(int element)
#add(Integer) but more efficient in that it doesn't box the element.addInt in interface Internal.IntListprivate void addInt(int index,
int element)
add(int, Integer) but more efficient in that it doesn't box the element.public boolean addAll(java.util.Collection<? extends java.lang.Integer> collection)
addAll in interface java.util.Collection<java.lang.Integer>addAll in interface java.util.List<java.lang.Integer>addAll in class AbstractProtobufList<java.lang.Integer>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<java.lang.Integer>remove in interface java.util.List<java.lang.Integer>remove in class AbstractProtobufList<java.lang.Integer>public java.lang.Integer remove(int index)
remove in interface java.util.List<java.lang.Integer>remove in class AbstractProtobufList<java.lang.Integer>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)