Top Description Inners Fields Constructors Methods
com.google.protobuf

public Class LazyStringArrayList

extends AbstractProtobufList<String>
implements LazyStringList, RandomAccess
Class Inheritance
All Implemented Interfaces
java.util.RandomAccess, com.google.protobuf.LazyStringList, com.google.protobuf.ProtocolStringList, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable
Imports
java.util.AbstractList, .ArrayList, .Arrays, .Collection, .Collections, .List, .RandomAccess

An implementation of LazyStringList that wraps an ArrayList. Each element is one of String, ByteString, or byte[]. It caches the last one requested which is most likely the one needed next. This minimizes memory usage while satisfying the most common use cases.

Note that this implementation is not synchronized. If multiple threads access an ArrayList instance concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements, or explicitly resizes the backing array; merely setting the value of an element is not a structural modification.) This is typically accomplished by synchronizing on some object that naturally encapsulates the list.

If the implementation is accessed via concurrent reads, this is thread safe. Conversions are done in a thread safe manner. It's possible that the conversion may happen more than once if two threads attempt to access the same element and the modifications were not visible to each other, but this will not result in any corruption of the list or change in behavior other than performance.

Author
[email protected] (Jon Perlow)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
public
LazyStringArrayList(int initialCapacity)

public
public
private

Method Summary

Modifier and TypeMethod and Description
public void
add(int
index at which the specified element is to be inserted
index
,
String
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).
private void
add(int
index at which the specified element is to be inserted
index
,
ByteString
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).
private void
add(int
index at which the specified element is to be inserted
index
,
byte[]
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 void
add(ByteString
element to be appended to this list
element
)

Overrides com.google.protobuf.AbstractProtobufList.add.

Implements com.google.protobuf.LazyStringList.add, java.util.List.add, java.util.Collection.add.

Appends the specified element to the end of this list (optional operation).
public void
add(byte[]
element to be appended to this list
element
)

Overrides com.google.protobuf.AbstractProtobufList.add.

Implements com.google.protobuf.LazyStringList.add, java.util.List.add, java.util.Collection.add.

Appends the specified element to the end of this list (optional operation).
public boolean
addAll(Collection<? extends String>
collection containing elements to be added to this list
c
)

Overrides com.google.protobuf.AbstractProtobufList.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).
public boolean
addAll(int
index at which to insert the first element from the specified collection
index
,
Collection<? extends String>
collection containing elements to be added to this list
c
)

Overrides com.google.protobuf.AbstractProtobufList.addAll.

Implements java.util.List.addAll.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).
public boolean
addAllByteArray(Collection<byte[]>
collection whose elements are to be added to this list
c
)

Implements com.google.protobuf.LazyStringList.addAllByteArray.

Appends all elements in the specified byte[] collection to the end of this list.
public boolean
addAllByteString(Collection<? extends ByteString>
collection whose elements are to be added to this list
values
)

Implements com.google.protobuf.LazyStringList.addAllByteString.

Appends all elements in the specified ByteString collection to the end of this list.
private static byte[]
public List<byte[]>
asByteArrayList()

Implements com.google.protobuf.LazyStringList.asByteArrayList.

Returns a mutable view of this list.
private static ByteString
public List<ByteString>
asByteStringList()

Implements com.google.protobuf.ProtocolStringList.asByteStringList.

Returns a view of the data as a list of ByteStrings.
private static String
public void
clear()

Overrides com.google.protobuf.AbstractProtobufList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Removes all of the elements from this list (optional operation).
pack-priv static LazyStringArrayList
public String
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 byte[]
getByteArray(int
index of the element to return
index
)

Implements com.google.protobuf.LazyStringList.getByteArray.

Returns the element at the specified position in this list as byte[].
public ByteString
getByteString(int
index of the element to return
index
)

Implements com.google.protobuf.LazyStringList.getByteString.

Returns the element at the specified position in this list as a ByteString.
public Object
getRaw(int
index of the element to return
index
)

Implements com.google.protobuf.LazyStringList.getRaw.

Returns the element at the specified position in this list as an Object that will either be a String or a ByteString.
public List<?>
getUnderlyingElements()

Implements com.google.protobuf.LazyStringList.getUnderlyingElements.

Returns an unmodifiable List of the underlying elements, each of which is either a String or its equivalent UTF-8 encoded ByteString or byte[].
public LazyStringList
getUnmodifiableView()

Implements com.google.protobuf.LazyStringList.getUnmodifiableView.

Returns an unmodifiable view of the list.
public void
mergeFrom(LazyStringList other)

Implements com.google.protobuf.LazyStringList.mergeFrom.

Merges all elements from another LazyStringList into this one.
public LazyStringArrayList
mutableCopyWithCapacity(int capacity)

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

Returns a mutable clone of this list with the specified capacity.
public String
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 String
set(int
index of the element to replace
index
,
String
element to be stored at the specified position
s
)

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 void
set(int
index of the element to replace
index
,
ByteString
the element to be stored at the specified position
s
)

Overrides com.google.protobuf.AbstractProtobufList.set.

Implements com.google.protobuf.LazyStringList.set, java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).
public void
set(int
index of the element to replace
index
,
byte[]
the element to be stored at the specified position
s
)

Overrides com.google.protobuf.AbstractProtobufList.set.

Implements com.google.protobuf.LazyStringList.set, java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).
private Object
setAndReturn(int index, ByteString s)

private Object
setAndReturn(int index, byte[] s)

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:
ensureIsMutableequalshashCodeisModifiablemakeImmutableremoveremoveAllretainAll

Field Detail

EMPTYback to summary
public static final LazyStringList EMPTY
EMPTY_LISTback to summary
private static final LazyStringArrayList EMPTY_LIST
listback to summary
private final List<Object> list

Constructor Detail

LazyStringArrayListback to summary
public LazyStringArrayList()
LazyStringArrayListback to summary
public LazyStringArrayList(int initialCapacity)
LazyStringArrayListback to summary
public LazyStringArrayList(LazyStringList from)
LazyStringArrayListback to summary
public LazyStringArrayList(List<String> from)
LazyStringArrayListback to summary
private LazyStringArrayList(ArrayList<Object> list)

Method Detail

addback to summary
public void add(int index, String 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:String

element to be inserted

Annotations
@Override
addback to summary
private void add(int index, ByteString 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:ByteString

element to be inserted

addback to summary
private void add(int index, byte[] 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:byte[]

element to be inserted

addback to summary
public void add(ByteString element)

Overrides com.google.protobuf.AbstractProtobufList.add.

Implements com.google.protobuf.LazyStringList.add, java.util.List.add, java.util.Collection.add.

Doc from com.google.protobuf.LazyStringList.add.

Appends the specified element to the end of this list (optional operation).

Parameters
element:ByteString

element to be appended to this list

Returns:void

Doc from java.util.List.add.

true (as specified by Collection#add)

Annotations
@Override
addback to summary
public void add(byte[] element)

Overrides com.google.protobuf.AbstractProtobufList.add.

Implements com.google.protobuf.LazyStringList.add, java.util.List.add, java.util.Collection.add.

Doc from com.google.protobuf.LazyStringList.add.

Appends the specified element to the end of this list (optional operation).

Parameters
element:byte[]

element to be appended to this list

Returns:void

Doc from java.util.List.add.

true (as specified by Collection#add)

Annotations
@Override
addAllback to summary
public boolean addAll(Collection<? extends String> c)

Overrides com.google.protobuf.AbstractProtobufList.addAll.

Implements java.util.List.addAll, java.util.Collection.addAll.

Doc from java.util.List.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

Parameters
c:Collection<? extends String>

collection containing elements to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Override
addAllback to summary
public boolean addAll(int index, Collection<? extends String> c)

Overrides com.google.protobuf.AbstractProtobufList.addAll.

Implements java.util.List.addAll.

Doc from java.util.List.addAll.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

Parameters
index:int

index at which to insert the first element from the specified collection

c:Collection<? extends String>

collection containing elements to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Override
addAllByteArrayback to summary
public boolean addAllByteArray(Collection<byte[]> c)

Implements com.google.protobuf.LazyStringList.addAllByteArray.

Doc from com.google.protobuf.LazyStringList.addAllByteArray.

Appends all elements in the specified byte[] collection to the end of this list.

Parameters
c:Collection<byte[]>

collection whose elements are to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Override
addAllByteStringback to summary
public boolean addAllByteString(Collection<? extends ByteString> values)

Implements com.google.protobuf.LazyStringList.addAllByteString.

Doc from com.google.protobuf.LazyStringList.addAllByteString.

Appends all elements in the specified ByteString collection to the end of this list.

Parameters
values:Collection<? extends ByteString>

collection whose elements are to be added to this list

Returns:boolean

true if this list changed as a result of the call

Annotations
@Override
asByteArrayback to summary
private static byte[] asByteArray(Object o)
asByteArrayListback to summary
public List<byte[]> asByteArrayList()

Implements com.google.protobuf.LazyStringList.asByteArrayList.

Doc from com.google.protobuf.LazyStringList.asByteArrayList.

Returns a mutable view of this list. Changes to the view will be made into the original list. This method is used in mutable API only.

Annotations
@Override
asByteStringback to summary
private static ByteString asByteString(Object o)
asByteStringListback to summary
public List<ByteString> asByteStringList()

Implements com.google.protobuf.ProtocolStringList.asByteStringList.

Doc from com.google.protobuf.ProtocolStringList.asByteStringList.

Returns a view of the data as a list of ByteStrings.

Annotations
@Override
asStringback to summary
private static String asString(Object o)
clearback to summary
public void clear()

Overrides com.google.protobuf.AbstractProtobufList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Doc from java.util.List.clear.

Removes all of the elements from this list (optional operation). The list will be empty after this call returns.

Annotations
@Override
emptyListback to summary
pack-priv static LazyStringArrayList emptyList()
getback to summary
public String 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:String

the element at the specified position in this list

Annotations
@Override
getByteArrayback to summary
public byte[] getByteArray(int index)

Implements com.google.protobuf.LazyStringList.getByteArray.

Doc from com.google.protobuf.LazyStringList.getByteArray.

Returns the element at the specified position in this list as byte[].

Parameters
index:int

index of the element to return

Returns:byte[]

the element at the specified position in this list

Annotations
@Override
getByteStringback to summary
public ByteString getByteString(int index)

Implements com.google.protobuf.LazyStringList.getByteString.

Doc from com.google.protobuf.LazyStringList.getByteString.

Returns the element at the specified position in this list as a ByteString.

Parameters
index:int

index of the element to return

Returns:ByteString

the element at the specified position in this list

Annotations
@Override
getRawback to summary
public Object getRaw(int index)

Implements com.google.protobuf.LazyStringList.getRaw.

Doc from com.google.protobuf.LazyStringList.getRaw.

Returns the element at the specified position in this list as an Object that will either be a String or a ByteString.

Parameters
index:int

index of the element to return

Returns:Object

the element at the specified position in this list

Annotations
@Override
getUnderlyingElementsback to summary
public List<?> getUnderlyingElements()

Implements com.google.protobuf.LazyStringList.getUnderlyingElements.

Doc from com.google.protobuf.LazyStringList.getUnderlyingElements.

Returns an unmodifiable List of the underlying elements, each of which is either a String or its equivalent UTF-8 encoded ByteString or byte[]. It is an error for the caller to modify the returned List, and attempting to do so will result in an UnsupportedOperationException.

Annotations
@Override
getUnmodifiableViewback to summary
public LazyStringList getUnmodifiableView()

Implements com.google.protobuf.LazyStringList.getUnmodifiableView.

Doc from com.google.protobuf.LazyStringList.getUnmodifiableView.

Returns an unmodifiable view of the list.

Annotations
@Override
mergeFromback to summary
public void mergeFrom(LazyStringList other)

Implements com.google.protobuf.LazyStringList.mergeFrom.

Doc from com.google.protobuf.LazyStringList.mergeFrom.

Merges all elements from another LazyStringList into this one. This method differs from addAll(Collection) on that underlying byte arrays are copied instead of reference shared. Immutable API doesn't need to use this method as byte[] is not used there at all.

Annotations
@Override
mutableCopyWithCapacityback to summary
public LazyStringArrayList 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 String 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:String

the element previously at the specified position

Annotations
@Override
setback to summary
public String set(int index, String s)

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

s:String

element to be stored at the specified position

Returns:String

the element previously at the specified position

Annotations
@Override
setback to summary
public void set(int index, ByteString s)

Overrides com.google.protobuf.AbstractProtobufList.set.

Implements com.google.protobuf.LazyStringList.set, java.util.List.set.

Doc from com.google.protobuf.LazyStringList.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

s:ByteString

the element to be stored at the specified position

Returns:void

Doc from java.util.List.set.

the element previously at the specified position

Annotations
@Override
setback to summary
public void set(int index, byte[] s)

Overrides com.google.protobuf.AbstractProtobufList.set.

Implements com.google.protobuf.LazyStringList.set, java.util.List.set.

Doc from com.google.protobuf.LazyStringList.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

s:byte[]

the element to be stored at the specified position

Returns:void

Doc from java.util.List.set.

the element previously at the specified position

Annotations
@Override
setAndReturnback to summary
private Object setAndReturn(int index, ByteString s)
setAndReturnback to summary
private Object setAndReturn(int index, byte[] s)
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
com.google.protobuf back to summary

private Class LazyStringArrayList.ByteArrayListView

extends AbstractList<byte[]>
implements RandomAccess
Class Inheritance
All Implemented Interfaces
java.util.RandomAccess

Field Summary

Modifier and TypeField and Description
private final LazyStringArrayList
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

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

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).
public byte[]
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 byte[]
remove(int
the index of the element to be removed
index
)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

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

Overrides java.util.AbstractList.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 java.util.AbstractList:
addaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesubList

Field Detail

listback to summary
private final LazyStringArrayList list

Constructor Detail

ByteArrayListViewback to summary
pack-priv ByteArrayListView(LazyStringArrayList list)

Method Detail

addback to summary
public void add(int index, byte[] s)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Doc from java.util.AbstractList.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

Doc from java.util.List.add.

index at which the specified element is to be inserted

s:byte[]

Doc from java.util.List.add.

element to be inserted

Annotations
@Override
getback to summary
public byte[] get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Parameters
index:int

Doc from java.util.List.get.

index of the element to return

Returns:byte[]

Doc from java.util.List.get.

the element at the specified position in this list

Annotations
@Override
removeback to summary
public byte[] remove(int index)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Doc from java.util.AbstractList.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

Doc from java.util.List.remove.

the index of the element to be removed

Returns:byte[]

Doc from java.util.List.remove.

the element previously at the specified position

Annotations
@Override
setback to summary
public byte[] set(int index, byte[] s)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Doc from java.util.AbstractList.set.

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

Parameters
index:int

Doc from java.util.List.set.

index of the element to replace

s:byte[]

Doc from java.util.List.set.

element to be stored at the specified position

Returns:byte[]

Doc from java.util.List.set.

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
com.google.protobuf back to summary

private Class LazyStringArrayList.ByteStringListView

extends AbstractList<ByteString>
implements RandomAccess
Class Inheritance
All Implemented Interfaces
java.util.RandomAccess

Field Summary

Modifier and TypeField and Description
private final LazyStringArrayList
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

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

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).
public ByteString
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 ByteString
remove(int
the index of the element to be removed
index
)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

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

Overrides java.util.AbstractList.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 java.util.AbstractList:
addaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesubList

Field Detail

listback to summary
private final LazyStringArrayList list

Constructor Detail

ByteStringListViewback to summary
pack-priv ByteStringListView(LazyStringArrayList list)

Method Detail

addback to summary
public void add(int index, ByteString s)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Doc from java.util.AbstractList.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

Doc from java.util.List.add.

index at which the specified element is to be inserted

s:ByteString

Doc from java.util.List.add.

element to be inserted

Annotations
@Override
getback to summary
public ByteString get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Parameters
index:int

Doc from java.util.List.get.

index of the element to return

Returns:ByteString

Doc from java.util.List.get.

the element at the specified position in this list

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

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Doc from java.util.AbstractList.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

Doc from java.util.List.remove.

the index of the element to be removed

Returns:ByteString

Doc from java.util.List.remove.

the element previously at the specified position

Annotations
@Override
setback to summary
public ByteString set(int index, ByteString s)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Doc from java.util.AbstractList.set.

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

Parameters
index:int

Doc from java.util.List.set.

index of the element to replace

s:ByteString

Doc from java.util.List.set.

element to be stored at the specified position

Returns:ByteString

Doc from java.util.List.set.

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