webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Public Member Functions | |
LazyStringArrayList () | |
LazyStringArrayList (int intialCapacity) | |
LazyStringArrayList (LazyStringList from) | |
LazyStringArrayList (List< String > from) | |
LazyStringArrayList | mutableCopyWithCapacity (int capacity) |
String | get (int index) |
int | size () |
String | set (int index, String s) |
void | add (int index, String element) |
boolean | addAll (Collection<? extends String > c) |
boolean | addAll (int index, Collection<? extends String > c) |
boolean | addAllByteString (Collection<? extends ByteString > values) |
boolean | addAllByteArray (Collection< byte[]> c) |
String | remove (int index) |
void | clear () |
void | add (ByteString element) |
void | add (byte[] element) |
Object | getRaw (int index) |
ByteString | getByteString (int index) |
byte [] | getByteArray (int index) |
void | set (int index, ByteString s) |
void | set (int index, byte[] s) |
List<?> | getUnderlyingElements () |
void | mergeFrom (LazyStringList other) |
List< byte[]> | asByteArrayList () |
List< ByteString > | asByteStringList () |
LazyStringList | getUnmodifiableView () |
Static Public Attributes | |
static final LazyStringList | EMPTY = EMPTY_LIST |
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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Appends the specified element to the end of this list (optional operation).
element | element to be appended to this list |
UnsupportedOperationException | if the add operation is not supported by this list |
Implements com.google.protobuf.LazyStringList.
|
inline |
Appends the specified element to the end of this list (optional operation).
element | element to be appended to this list |
UnsupportedOperationException | if the add operation is not supported by this list |
Implements com.google.protobuf.LazyStringList.
|
inline |
|
inline |
|
inline |
Appends all elements in the specified byte[] collection to the end of this list.
c | collection whose elements are to be added to this list |
UnsupportedOperationException | if the addAllByteArray operation is not supported by this list |
Implements com.google.protobuf.LazyStringList.
|
inline |
Appends all elements in the specified ByteString collection to the end of this list.
c | collection whose elements are to be added to this list |
UnsupportedOperationException | if the addAllByteString operation is not supported by this list |
Implements com.google.protobuf.LazyStringList.
|
inline |
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.
Implements com.google.protobuf.LazyStringList.
|
inline |
Returns a view of the data as a list of ByteStrings.
Implements com.google.protobuf.ProtocolStringList.
|
inline |
|
inline |
|
inline |
Returns the element at the specified position in this list as byte[].
index | index of the element to return |
IndexOutOfBoundsException | if the index is out of range ( ) |
Implements com.google.protobuf.LazyStringList.
|
inline |
Returns the element at the specified position in this list as a ByteString.
index | index of the element to return |
IndexOutOfBoundsException | if the index is out of range ( ) |
Implements com.google.protobuf.LazyStringList.
|
inline |
Returns the element at the specified position in this list as an Object that will either be a String or a ByteString.
index | index of the element to return |
IndexOutOfBoundsException | if the index is out of range ( ) |
Implements com.google.protobuf.LazyStringList.
|
inline |
Returns an unmodifiable List of the underlying elements, each of which is either a
or its equivalent UTF-8 encoded
or byte[]. It is an error for the caller to modify the returned List, and attempting to do so will result in an UnsupportedOperationException.
Implements com.google.protobuf.LazyStringList.
|
inline |
Returns an unmodifiable view of the list.
Implements com.google.protobuf.LazyStringList.
|
inline |
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.
Implements com.google.protobuf.LazyStringList.
|
inline |
|
inline |
|
inline |
|
inline |
Replaces the element at the specified position in this list with the specified element (optional operation).
index | index of the element to replace |
element | the element to be stored at the specified position |
UnsupportedOperationException | if the set operation is not supported by this list IndexOutOfBoundsException if the index is out of range ( ) |
Implements com.google.protobuf.LazyStringList.
|
inline |
Replaces the element at the specified position in this list with the specified element (optional operation).
index | index of the element to replace |
element | the element to be stored at the specified position |
UnsupportedOperationException | if the set operation is not supported by this list IndexOutOfBoundsException if the index is out of range ( ) |
Implements com.google.protobuf.LazyStringList.
|
inline |
|
static |