Package com.google.protobuf
Interface Internal.IntList
- All Superinterfaces:
Collection<Integer>
,Internal.ProtobufList<Integer>
,Iterable<Integer>
,List<Integer>
,RandomAccess
,SequencedCollection<Integer>
- Enclosing class:
Internal
A
List
implementation that avoids boxing the elements into Integers if
possible. Does not support null elements.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addInt
(int element) LikeList.add(Object)
but more efficient in that it doesn't box the element.int
getInt
(int index) LikeList.get(int)
but more efficient in that it doesn't box the returned value.mutableCopyWithCapacity
(int capacity) Returns a mutable clone of this list with the specified capacity.int
setInt
(int index, int element) LikeList.set(int, Object)
but more efficient in that it doesn't box the element.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface com.google.protobuf.Internal.ProtobufList
isModifiable, makeImmutable
Methods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArray
-
Method Details
-
getInt
int getInt(int index) LikeList.get(int)
but more efficient in that it doesn't box the returned value. -
addInt
void addInt(int element) LikeList.add(Object)
but more efficient in that it doesn't box the element. -
setInt
@CanIgnoreReturnValue int setInt(int index, int element) LikeList.set(int, Object)
but more efficient in that it doesn't box the element. -
mutableCopyWithCapacity
Returns a mutable clone of this list with the specified capacity.- Specified by:
mutableCopyWithCapacity
in interfaceInternal.ProtobufList<Integer>
-