Class CharArrayDictionary<TValue>.ValueCollection
Class that represents the values in the CharArrayDictionary<TValue>.
Inherited Members
Namespace: Lucene.Net.Analysis.Util
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class CharArrayDictionary<TValue>.ValueCollection : ICollection<TValue>, ICollection, IReadOnlyCollection<TValue>, IEnumerable<TValue>, IEnumerable
Constructors
ValueCollection(CharArrayDictionary<TValue>)
Initializes a new instance of CharArrayDictionary<TValue>.ValueCollection for the provided CharArrayDictionary<TValue>.
Declaration
public ValueCollection(CharArrayDictionary<TValue> dictionary)
Parameters
Type | Name | Description |
---|---|---|
CharArrayDictionary<TValue> | dictionary | The dictionary to read the values from. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Properties
Count
Gets the number of elements contained in the CharArrayDictionary<TValue>.ValueCollection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Retrieving the value of this property is an O(1) operation.
Methods
Contains(TValue)
Determines whether the set contains a specific element.
Declaration
public bool Contains(TValue item)
Parameters
Type | Name | Description |
---|---|---|
TValue | item | The element to locate in the set. |
Returns
Type | Description |
---|---|
bool |
|
CopyTo(TValue[], int)
Copies the CharArrayDictionary<TValue>.ValueCollection elements to an existing one-dimensional array, starting at the specified array index.
Declaration
public void CopyTo(TValue[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
TValue[] | array | The one-dimensional array that is the destination of the elements copied from the CharArrayDictionary<TValue>.ValueCollection. The array must have zero-based indexing. |
int | arrayIndex | The zero-based index in |
Remarks
The elements are copied to the array in the same order in which the enumerator iterates through the CharArrayDictionary<TValue>.ValueCollection.
This method is an O(n
) operation, where n
is Count.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException | The number of elements in the source CharArrayDictionary<TValue>.ValueCollection
is greater than the available space from |
GetEnumerator()
Returns an enumerator that iterates through the CharArrayDictionary<TValue>.ValueCollection.
Declaration
public CharArrayDictionary<TValue>.ValueCollection.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
CharArrayDictionary<TValue>.ValueCollection.Enumerator | An enumerator that iterates through the CharArrayDictionary<TValue>.ValueCollection. |
Remarks
An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to MoveNext() or Reset() throws an InvalidOperationException.
This method is anO(log n)
operation.
ToString()
Returns a string that represents the current collection.
The presentation has a specific format. It is enclosed by square brackets ("[]"). Elements are separated by ', ' (comma and space).null
values are represented as the string "null".
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current collection. |