public class UnmodifiableLazyStringList extends AbstractList<String> implements LazyStringList, RandomAccess
LazyStringList that wraps another
LazyStringList such that it cannot be modified via the wrapper.modCount| Constructor and Description |
|---|
UnmodifiableLazyStringList(LazyStringList list) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(byte[] element)
Appends the specified element to the end of this list (optional
operation).
|
void |
add(ByteString element)
Appends the specified element to the end of this list (optional
operation).
|
boolean |
addAllByteArray(Collection<byte[]> element)
Appends all elements in the specified byte[] collection to the end of
this list.
|
boolean |
addAllByteString(Collection<? extends ByteString> element)
Appends all elements in the specified ByteString collection to the end of
this list.
|
List<byte[]> |
asByteArrayList()
Returns a mutable view of this list.
|
List<ByteString> |
asByteStringList()
Returns a view of the data as a list of ByteStrings.
|
String |
get(int index) |
byte[] |
getByteArray(int index)
Returns the element at the specified position in this list as byte[].
|
ByteString |
getByteString(int index)
Returns the element at the specified position in this list as a ByteString.
|
Object |
getRaw(int index)
Returns the element at the specified position in this list as an Object
that will either be a String or a ByteString.
|
List<?> |
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[]. |
LazyStringList |
getUnmodifiableView()
Returns an unmodifiable view of the list.
|
Iterator<String> |
iterator() |
ListIterator<String> |
listIterator(int index) |
void |
mergeFrom(LazyStringList other)
Merges all elements from another LazyStringList into this one.
|
void |
set(int index,
byte[] element)
Replaces the element at the specified position in this list with the
specified element (optional operation).
|
void |
set(int index,
ByteString element)
Replaces the element at the specified position in this list with the
specified element (optional operation).
|
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArrayparallelStream, removeIf, streampublic UnmodifiableLazyStringList(LazyStringList list)
public String get(int index)
public Object getRaw(int index)
LazyStringListgetRaw in interface LazyStringListindex - index of the element to returnpublic int size()
size in interface Collection<String>size in interface List<String>size in class AbstractCollection<String>public ByteString getByteString(int index)
LazyStringListgetByteString in interface LazyStringListindex - index of the element to returnpublic void add(ByteString element)
LazyStringListadd in interface LazyStringListelement - element to be appended to this listpublic void set(int index,
ByteString element)
LazyStringListset in interface LazyStringListindex - index of the element to replaceelement - the element to be stored at the specified positionpublic boolean addAllByteString(Collection<? extends ByteString> element)
LazyStringListaddAllByteString in interface LazyStringListelement - collection whose elements are to be added to this listpublic byte[] getByteArray(int index)
LazyStringListgetByteArray in interface LazyStringListindex - index of the element to returnpublic void add(byte[] element)
LazyStringListadd in interface LazyStringListelement - element to be appended to this listpublic void set(int index,
byte[] element)
LazyStringListset in interface LazyStringListindex - index of the element to replaceelement - the element to be stored at the specified positionpublic boolean addAllByteArray(Collection<byte[]> element)
LazyStringListaddAllByteArray in interface LazyStringListelement - collection whose elements are to be added to this listpublic ListIterator<String> listIterator(int index)
listIterator in interface List<String>listIterator in class AbstractList<String>public List<?> getUnderlyingElements()
LazyStringListString 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.getUnderlyingElements in interface LazyStringListpublic void mergeFrom(LazyStringList other)
LazyStringListList.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.mergeFrom in interface LazyStringListpublic List<byte[]> asByteArrayList()
LazyStringListasByteArrayList in interface LazyStringListpublic List<ByteString> asByteStringList()
ProtocolStringListasByteStringList in interface ProtocolStringListpublic LazyStringList getUnmodifiableView()
LazyStringListgetUnmodifiableView in interface LazyStringListCopyright © 2008–2016 Google. All rights reserved.