Top Description Fields Constructors Methods
com.google.protobuf

public Class UnmodifiableLazyStringList

extends AbstractList<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, .Collection, .Collections, .Iterator, .List, .ListIterator, .RandomAccess

An implementation of LazyStringList that wraps another LazyStringList such that it cannot be modified via the wrapper.
Author
[email protected] (Jon Perlow)

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(ByteString
element to be appended to this list
element
)

Overrides java.util.AbstractList.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 java.util.AbstractList.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
addAllByteArray(Collection<byte[]>
collection whose elements are to be added to this list
element
)

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
element
)

Implements com.google.protobuf.LazyStringList.addAllByteString.

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

Implements com.google.protobuf.LazyStringList.asByteArrayList.

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

Implements com.google.protobuf.ProtocolStringList.asByteStringList.

Returns a view of the data as a list of ByteStrings.
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 Iterator<String>
iterator()

Overrides java.util.AbstractList.iterator.

Implements java.util.List.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this list in proper sequence.
public ListIterator<String>
listIterator(final int
index of the first element to be returned from the list iterator (by a call to next)
index
)

Overrides java.util.AbstractList.listIterator.

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
public void
mergeFrom(LazyStringList other)

Implements com.google.protobuf.LazyStringList.mergeFrom.

Merges all elements from another LazyStringList into this one.
public void
set(int
index of the element to replace
index
,
ByteString
the element to be stored at the specified position
element
)

Overrides java.util.AbstractList.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
element
)

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

Field Detail

listback to summary
private final LazyStringList list

Constructor Detail

UnmodifiableLazyStringListback to summary
public UnmodifiableLazyStringList(LazyStringList list)

Method Detail

addback to summary
public void add(ByteString element)

Overrides java.util.AbstractList.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 java.util.AbstractList.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
addAllByteArrayback to summary
public boolean addAllByteArray(Collection<byte[]> element)

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
element: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> element)

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
element: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
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
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
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
iteratorback to summary
public Iterator<String> iterator()

Overrides java.util.AbstractList.iterator.

Implements java.util.List.iterator, java.util.Collection.iterator.

Doc from java.util.List.iterator.

Returns an iterator over the elements in this list in proper sequence.

Returns:Iterator<String>

an iterator over the elements in this list in proper sequence

Annotations
@Override
listIteratorback to summary
public ListIterator<String> listIterator(final int index)

Overrides java.util.AbstractList.listIterator.

Implements java.util.List.listIterator.

Doc from java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. The specified index indicates the first element that would be returned by an initial call to next. An initial call to previous would return the element with the specified index minus one.

Parameters
index:int

index of the first element to be returned from the list iterator (by a call to next)

Returns:ListIterator<String>

a list iterator over the elements in this list (in proper sequence), starting at the specified position in 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
setback to summary
public void set(int index, ByteString element)

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

element: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[] element)

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

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