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