webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Properties | List of all members
Google.Protobuf.Collections.RepeatedField< T > Class Template Reference

The contents of a repeated field: essentially, a collection with some extra restrictions (no null values) and capabilities (deep cloning). More...

Inheritance diagram for Google.Protobuf.Collections.RepeatedField< T >:

Public Member Functions

RepeatedField< TClone ()
 Creates a deep clone of this repeated field. More...
 
void AddEntriesFrom (CodedInputStream input, FieldCodec< T > codec)
 Adds the entries from the given input stream, decoding them with the specified codec. More...
 
int CalculateSize (FieldCodec< T > codec)
 Calculates the size of this collection based on the given codec. More...
 
void WriteTo (CodedOutputStream output, FieldCodec< T > codec)
 Writes the contents of this collection to the given CodedOutputStream, encoding each value using the specified codec. More...
 
void Add (T item)
 Adds the specified item to the collection. More...
 
void Clear ()
 Removes all items from the collection. More...
 
bool Contains (T item)
 Determines whether this collection contains the given item. More...
 
void CopyTo (T[] array, int arrayIndex)
 Copies this collection to the given array. More...
 
bool Remove (T item)
 Removes the specified item from the collection More...
 
void Add (RepeatedField< T > values)
 Adds all of the specified values into this collection. More...
 
void Add (IEnumerable< T > values)
 Adds all of the specified values into this collection. More...
 
IEnumerator< TGetEnumerator ()
 Returns an enumerator that iterates through the collection. More...
 
override bool Equals (object obj)
 Determines whether the specified System.Object, is equal to this instance. More...
 
override int GetHashCode ()
 Returns a hash code for this instance. More...
 
bool Equals (RepeatedField< T > other)
 Compares this repeated field with another for equality. More...
 
int IndexOf (T item)
 Returns the index of the given item within the collection, or -1 if the item is not present. More...
 
void Insert (int index, T item)
 Inserts the given item at the specified index. More...
 
void RemoveAt (int index)
 Removes the item at the given index. More...
 
override string ToString ()
 Returns a string representation of this repeated field, in the same way as it would be represented by the default JSON formatter. More...
 

Properties

int Count [get]
 Gets the number of elements contained in the collection. More...
 
bool IsReadOnly [get]
 Gets a value indicating whether the collection is read-only. More...
 
T this[int index] [get, set]
 Gets or sets the item at the specified index. More...
 

Detailed Description

The contents of a repeated field: essentially, a collection with some extra restrictions (no null values) and capabilities (deep cloning).

This implementation does not generally prohibit the use of types which are not supported by Protocol Buffers but nor does it guarantee that all operations will work in such cases.

Template Parameters
TThe element type of the repeated field.

Member Function Documentation

◆ Add() [1/3]

Adds the specified item to the collection.

Parameters
itemThe item to add.

◆ Add() [2/3]

Adds all of the specified values into this collection.

Parameters
valuesThe values to add to this collection.

◆ Add() [3/3]

void Google.Protobuf.Collections.RepeatedField< T >.Add ( IEnumerable< T values)
inline

Adds all of the specified values into this collection.

Parameters
valuesThe values to add to this collection.

◆ AddEntriesFrom()

void Google.Protobuf.Collections.RepeatedField< T >.AddEntriesFrom ( CodedInputStream  input,
FieldCodec< T codec 
)
inline

Adds the entries from the given input stream, decoding them with the specified codec.

Parameters
inputThe input stream to read from.
codecThe codec to use in order to read each entry.

◆ CalculateSize()

int Google.Protobuf.Collections.RepeatedField< T >.CalculateSize ( FieldCodec< T codec)
inline

Calculates the size of this collection based on the given codec.

Parameters
codecThe codec to use when encoding each field.
Returns
The number of bytes that would be written to a CodedOutputStream by WriteTo, using the same codec.

◆ Clear()

Removes all items from the collection.

◆ Clone()

Creates a deep clone of this repeated field.

If the field type is a message type, each element is also cloned; otherwise, it is assumed that the field type is primitive (including string and bytes, both of which are immutable) and so a simple copy is equivalent to a deep clone.

Returns
A deep clone of this repeated field.

◆ Contains()

bool Google.Protobuf.Collections.RepeatedField< T >.Contains ( T  item)
inline

Determines whether this collection contains the given item.

Parameters
itemThe item to find.
Returns
true if this collection contains the given item; false otherwise.

◆ CopyTo()

void Google.Protobuf.Collections.RepeatedField< T >.CopyTo ( T []  array,
int  arrayIndex 
)
inline

Copies this collection to the given array.

Parameters
arrayThe array to copy to.
arrayIndexThe first index of the array to copy to.

◆ Equals() [1/2]

override bool Google.Protobuf.Collections.RepeatedField< T >.Equals ( object  obj)
inline

Determines whether the specified System.Object, is equal to this instance.

Parameters
objThe System.Object to compare with this instance.
Returns
true if the specified System.Object is equal to this instance; otherwise, false.

◆ Equals() [2/2]

bool Google.Protobuf.Collections.RepeatedField< T >.Equals ( RepeatedField< T other)
inline

Compares this repeated field with another for equality.

Parameters
otherThe repeated field to compare this with.
Returns
true if other refers to an equal repeated field; false otherwise.

◆ GetEnumerator()

IEnumerator<T> Google.Protobuf.Collections.RepeatedField< T >.GetEnumerator ( )
inline

Returns an enumerator that iterates through the collection.

Returns
An enumerator that can be used to iterate through the collection.

◆ GetHashCode()

override int Google.Protobuf.Collections.RepeatedField< T >.GetHashCode ( )
inline

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

◆ IndexOf()

int Google.Protobuf.Collections.RepeatedField< T >.IndexOf ( T  item)
inline

Returns the index of the given item within the collection, or -1 if the item is not present.

Parameters
itemThe item to find in the collection.
Returns
The zero-based index of the item, or -1 if it is not found.

◆ Insert()

void Google.Protobuf.Collections.RepeatedField< T >.Insert ( int  index,
T  item 
)
inline

Inserts the given item at the specified index.

Parameters
indexThe index at which to insert the item.
itemThe item to insert.

◆ Remove()

bool Google.Protobuf.Collections.RepeatedField< T >.Remove ( T  item)
inline

Removes the specified item from the collection

Parameters
itemThe item to remove.
Returns
true if the item was found and removed; false otherwise.

◆ RemoveAt()

void Google.Protobuf.Collections.RepeatedField< T >.RemoveAt ( int  index)
inline

Removes the item at the given index.

Parameters
indexThe zero-based index of the item to remove.

◆ ToString()

override string Google.Protobuf.Collections.RepeatedField< T >.ToString ( )
inline

Returns a string representation of this repeated field, in the same way as it would be represented by the default JSON formatter.

◆ WriteTo()

void Google.Protobuf.Collections.RepeatedField< T >.WriteTo ( CodedOutputStream  output,
FieldCodec< T codec 
)
inline

Writes the contents of this collection to the given CodedOutputStream, encoding each value using the specified codec.

Parameters
outputThe output stream to write to.
codecThe codec to use when encoding each value.

Property Documentation

◆ Count

Gets the number of elements contained in the collection.

◆ IsReadOnly

Gets a value indicating whether the collection is read-only.

◆ this[int index]

Gets or sets the item at the specified index.

The element at the specified index.

Parameters
indexThe zero-based index of the element to get or set.
Returns
The item at the specified index.

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