Package com.google.protobuf
Class ProtobufArrayList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
com.google.protobuf.AbstractProtobufList<E>
com.google.protobuf.ProtobufArrayList<E>
- All Implemented Interfaces:
Internal.ProtobufList<E>,Iterable<E>,Collection<E>,List<E>,RandomAccess,SequencedCollection<E>
Implements
Internal.ProtobufList for non-primitive and String types.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate E[]private static final Object[]private static final ProtobufArrayList<Object> private intFields inherited from class com.google.protobuf.AbstractProtobufList
DEFAULT_CAPACITYFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)privateProtobufArrayList(E[] array, int size, boolean isMutable) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanprivate static <E> E[]createArray(int capacity) static <E> ProtobufArrayList<E> (package private) voidensureCapacity(int minCapacity) Ensures the backing array can fit at least minCapacity elements.private voidensureIndexInRange(int index) get(int index) private static intgrowSize(int previousSize) private StringmakeOutOfBoundsExceptionMessage(int index) mutableCopyWithCapacity(int capacity) Returns a mutable clone of this list with the specified capacity.remove(int index) intsize()Methods inherited from class com.google.protobuf.AbstractProtobufList
addAll, addAll, clear, ensureIsMutable, equals, hashCode, isModifiable, makeImmutable, remove, removeAll, retainAllMethods inherited from class java.util.AbstractList
indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, contains, containsAll, getFirst, getLast, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeFirst, removeLast, replaceAll, reversed, sort, spliterator, subList, toArray, toArray
-
Field Details
-
EMPTY_ARRAY
-
EMPTY_LIST
-
array
-
size
private int size
-
-
Constructor Details
-
ProtobufArrayList
ProtobufArrayList() -
ProtobufArrayList
-
-
Method Details
-
emptyList
-
mutableCopyWithCapacity
Description copied from interface:Internal.ProtobufListReturns a mutable clone of this list with the specified capacity.- Specified by:
mutableCopyWithCapacityin interfaceInternal.ProtobufList<E>
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceList<E>- Overrides:
addin classAbstractProtobufList<E>
-
growSize
private static int growSize(int previousSize) -
add
-
get
-
remove
-
set
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>
-
ensureCapacity
void ensureCapacity(int minCapacity) Ensures the backing array can fit at least minCapacity elements. -
createArray
private static <E> E[] createArray(int capacity) -
ensureIndexInRange
private void ensureIndexInRange(int index) -
makeOutOfBoundsExceptionMessage
-