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
Implements
Internal.ProtobufList for non-primitive and String types.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate E[]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>private voidensureIndexInRange(int index) get(int index) 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
contains, containsAll, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, replaceAll, sort, spliterator, subList, toArray, toArray
-
Field Details
-
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>
-
add
-
get
-
remove
-
set
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>
-
createArray
private static <E> E[] createArray(int capacity) -
ensureIndexInRange
private void ensureIndexInRange(int index) -
makeOutOfBoundsExceptionMessage
-