webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | List of all members
com.google.protobuf.LazyStringList Interface Reference
Inheritance diagram for com.google.protobuf.LazyStringList:
com.google.protobuf.ProtocolStringList com.google.protobuf.LazyStringArrayList com.google.protobuf.UnmodifiableLazyStringList

Public Member Functions

ByteString getByteString (int index)
 
Object getRaw (int index)
 
byte [] getByteArray (int index)
 
void add (ByteString element)
 
void add (byte[] element)
 
void set (int index, ByteString element)
 
void set (int index, byte[] element)
 
boolean addAllByteString (Collection<? extends ByteString > c)
 
boolean addAllByteArray (Collection< byte[]> c)
 
List<?> getUnderlyingElements ()
 
void mergeFrom (LazyStringList other)
 
List< byte[]> asByteArrayList ()
 
LazyStringList getUnmodifiableView ()
 
- Public Member Functions inherited from com.google.protobuf.ProtocolStringList
List< ByteStringasByteStringList ()
 

Detailed Description

An interface extending

List<String>

that also provides access to the items of the list as UTF8-encoded ByteString or byte[] objects. This is used by the protocol buffer implementation to support lazily converting bytes parsed over the wire to String objects until needed and also increases the efficiency of serialization if the String was never requested as the ByteString or byte[] is already cached. The ByteString methods are used in immutable API only and byte[] methods used in mutable API only for they use different representations for string/bytes fields.

Author
jonp@.nosp@m.goog.nosp@m.le.co.nosp@m.m (Jon Perlow)

Member Function Documentation

◆ add() [1/2]

void com.google.protobuf.LazyStringList.add ( ByteString  element)

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

Parameters
elementelement to be appended to this list
Exceptions
UnsupportedOperationExceptionif the add operation is not supported by this list

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ add() [2/2]

void com.google.protobuf.LazyStringList.add ( byte []  element)

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

Parameters
elementelement to be appended to this list
Exceptions
UnsupportedOperationExceptionif the add operation is not supported by this list

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ addAllByteArray()

boolean com.google.protobuf.LazyStringList.addAllByteArray ( Collection< byte[]>  c)

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

Parameters
ccollection whose elements are to be added to this list
Returns
true if this list changed as a result of the call
Exceptions
UnsupportedOperationExceptionif the addAllByteArray operation is not supported by this list

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ addAllByteString()

boolean com.google.protobuf.LazyStringList.addAllByteString ( Collection<? extends ByteString c)

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

Parameters
ccollection whose elements are to be added to this list
Returns
true if this list changed as a result of the call
Exceptions
UnsupportedOperationExceptionif the addAllByteString operation is not supported by this list

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ asByteArrayList()

List<byte[]> 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.

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ getByteArray()

byte [] com.google.protobuf.LazyStringList.getByteArray ( int  index)

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

Parameters
indexindex of the element to return
Returns
the element at the specified position in this list
Exceptions
IndexOutOfBoundsExceptionif the index is out of range ( )

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ getByteString()

ByteString com.google.protobuf.LazyStringList.getByteString ( int  index)

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

Parameters
indexindex of the element to return
Returns
the element at the specified position in this list
Exceptions
IndexOutOfBoundsExceptionif the index is out of range ( )

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ getRaw()

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

Parameters
indexindex of the element to return
Returns
the element at the specified position in this list
Exceptions
IndexOutOfBoundsExceptionif the index is out of range ( )

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ getUnderlyingElements()

List<?> com.google.protobuf.LazyStringList.getUnderlyingElements ( )

Returns an unmodifiable List of the underlying elements, each of which is either a

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.

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ getUnmodifiableView()

LazyStringList com.google.protobuf.LazyStringList.getUnmodifiableView ( )

Returns an unmodifiable view of the list.

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ mergeFrom()

void com.google.protobuf.LazyStringList.mergeFrom ( LazyStringList  other)

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.

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ set() [1/2]

void com.google.protobuf.LazyStringList.set ( int  index,
ByteString  element 
)

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

Parameters
indexindex of the element to replace
elementthe element to be stored at the specified position
Exceptions
UnsupportedOperationExceptionif the set operation is not supported by this list IndexOutOfBoundsException if the index is out of range ( )

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.

◆ set() [2/2]

void com.google.protobuf.LazyStringList.set ( int  index,
byte []  element 
)

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

Parameters
indexindex of the element to replace
elementthe element to be stored at the specified position
Exceptions
UnsupportedOperationExceptionif the set operation is not supported by this list IndexOutOfBoundsException if the index is out of range ( )

Implemented in com.google.protobuf.LazyStringArrayList, and com.google.protobuf.UnmodifiableLazyStringList.


The documentation for this interface was generated from the following file: