Top Description Fields Constructors Methods
com.google.protobuf

pack-priv final Class ProtobufArrayList<E>

extends AbstractProtobufList<E>
Class Inheritance
Imports
com.google.protobuf.Internal.ProtobufList, java.util.ArrayList, .List

Implements ProtobufList for non-primitive and String types.

Field Summary

Modifier and TypeField and Description
private static final ProtobufArrayList<Object>
private final List<E>
Inherited from com.google.protobuf.AbstractProtobufList:
DEFAULT_CAPACITY

Constructor Summary

AccessConstructor and Description
pack-priv
private

Method Summary

Modifier and TypeMethod and Description
public void
add(int
index at which the specified element is to be inserted
index
,
E
element to be inserted
element
)

Overrides com.google.protobuf.AbstractProtobufList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).
public static <E> ProtobufArrayList<E>
public E
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
public ProtobufArrayList<E>
mutableCopyWithCapacity(int capacity)

Implements com.google.protobuf.Internal.ProtobufList.mutableCopyWithCapacity.

Returns a mutable clone of this list with the specified capacity.
public E
remove(int
the index of the element to be removed
index
)

Overrides com.google.protobuf.AbstractProtobufList.remove.

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).
public E
set(int
index of the element to replace
index
,
E
element to be stored at the specified position
element
)

Overrides com.google.protobuf.AbstractProtobufList.set.

Implements java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
Inherited from com.google.protobuf.AbstractProtobufList:
addaddAlladdAllclearensureIsMutableequalshashCodeisModifiablemakeImmutableremoveremoveAllretainAll

Field Detail

EMPTY_LISTback to summary
private static final ProtobufArrayList<Object> EMPTY_LIST
listback to summary
private final List<E> list

Constructor Detail

ProtobufArrayListback to summary
pack-priv ProtobufArrayList()
ProtobufArrayListback to summary
private ProtobufArrayList(List<E> list)

Method Detail

addback to summary
public void add(int index, E element)

Overrides com.google.protobuf.AbstractProtobufList.add.

Implements java.util.List.add.

Doc from java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters
index:int

index at which the specified element is to be inserted

element:E

element to be inserted

Annotations
@Override
emptyListback to summary
public static <E> ProtobufArrayList<E> emptyList()
Annotations
@SuppressWarnings:unchecked
getback to summary
public E get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:E

the element at the specified position in this list

Annotations
@Override
mutableCopyWithCapacityback to summary
public ProtobufArrayList<E> mutableCopyWithCapacity(int capacity)

Implements com.google.protobuf.Internal.ProtobufList.mutableCopyWithCapacity.

Doc from com.google.protobuf.Internal.ProtobufList.mutableCopyWithCapacity.

Returns a mutable clone of this list with the specified capacity.

Annotations
@Override
removeback to summary
public E remove(int index)

Overrides com.google.protobuf.AbstractProtobufList.remove.

Implements java.util.List.remove.

Doc from java.util.List.remove.

Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Parameters
index:int

the index of the element to be removed

Returns:E

the element previously at the specified position

Annotations
@Override
setback to summary
public E set(int index, E element)

Overrides com.google.protobuf.AbstractProtobufList.set.

Implements java.util.List.set.

Doc from java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

Parameters
index:int

index of the element to replace

element:E

element to be stored at the specified position

Returns:E

the element previously at the specified position

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

Annotations
@Override