Class CharArrayDictionary<TValue>
A simple class that stores text strings as char[]'s in a hash table. Note that this is not a general purpose class. For example, it cannot remove items from the dictionary, nor does it resize its hash table to be smaller, etc. It is designed to be quick to retrieve items by char[] keys without the necessity of converting to a string first.
You must specify the required Lucene.Net.Util.LuceneVersion compatibility when creating CharArrayDictionary<TValue>:
- As of 3.1, supplementary characters are properly lowercased.
Inherited Members
Namespace: Lucene.Net.Analysis.Util
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public class CharArrayDictionary<TValue> : IDictionary<string, TValue>, ICollection<KeyValuePair<string, TValue>>, IDictionary, ICollection, IReadOnlyDictionary<string, TValue>, IReadOnlyCollection<KeyValuePair<string, TValue>>, IEnumerable<KeyValuePair<string, TValue>>, IEnumerable
Type Parameters
Name | Description |
---|---|
TValue |
Constructors
CharArrayDictionary(LuceneVersion, IDictionary<ICharSequence, TValue>, bool)
Creates a dictionary from the mappings in another dictionary.
Declaration
public CharArrayDictionary(LuceneVersion matchVersion, IDictionary<ICharSequence, TValue> collection, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | compatibility match version see CharArrayDictionary<TValue> for details. |
IDictionary<ICharSequence, TValue> | collection | a dictionary (IDictionary{ICharSequence,V}) whose mappings to be copied. |
bool | ignoreCase |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CharArrayDictionary(LuceneVersion, IDictionary<char[], TValue>, bool)
Creates a dictionary from the mappings in another dictionary.
Declaration
public CharArrayDictionary(LuceneVersion matchVersion, IDictionary<char[], TValue> collection, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | compatibility match version see CharArrayDictionary<TValue> for details. |
IDictionary<char[], TValue> | collection | a dictionary (IDictionary{char[],V}) whose mappings to be copied. |
bool | ignoreCase |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CharArrayDictionary(LuceneVersion, IDictionary<string, TValue>, bool)
Creates a dictionary from the mappings in another dictionary.
Declaration
public CharArrayDictionary(LuceneVersion matchVersion, IDictionary<string, TValue> collection, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | compatibility match version see CharArrayDictionary<TValue> for details. |
IDictionary<string, TValue> | collection | a dictionary (IDictionary{string,V}) whose mappings to be copied. |
bool | ignoreCase |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CharArrayDictionary(LuceneVersion, int, bool)
Create dictionary with enough capacity to hold capacity
terms.
Declaration
public CharArrayDictionary(LuceneVersion matchVersion, int capacity, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | lucene compatibility version - see CharArrayDictionary<TValue> for details. |
int | capacity | the initial capacity |
bool | ignoreCase |
|
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Fields
Empty
Returns an empty, read-only dictionary.
Declaration
public static readonly CharArrayDictionary<TValue> Empty
Field Value
Type | Description |
---|---|
CharArrayDictionary<TValue> |
Properties
Count
Gets the number of text/value pairs contained in the CharArrayDictionary<TValue>.
Declaration
public virtual int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsReadOnly
true
if the CharArrayDictionary<TValue> is read-only; otherwise false
.
Declaration
public virtual bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
this[ICharSequence]
Gets or sets the value associated with the specified text.
Declaration
public virtual TValue this[ICharSequence text] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text | The text of the value to get or set. |
Property Value
Type | Description |
---|---|
TValue |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
text 's J2N.Text.ICharSequence.HasValue property returns false .
|
this[char[]]
Gets or sets the value associated with the specified text.
Note: If ignoreCase istrue
for this dictionary, the text array will be directly modified.
The user should never modify this text array after calling this setter.
Declaration
public virtual TValue this[char[] text] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
char[] | text | The text of the value to get or set. |
Property Value
Type | Description |
---|---|
TValue |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
this[char[], int, int]
Gets or sets the value associated with the specified text.
Note: If ignoreCase istrue
for this dictionary, the text array will be directly modified.
Declaration
public virtual TValue this[char[] text, int startIndex, int length] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
char[] | text | The text of the value to get or set. |
int | startIndex | The position of the |
int | length | The total length of the |
Property Value
Type | Description |
---|---|
TValue |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException |
|
this[object]
Gets or sets the value associated with the specified text.
Declaration
public virtual TValue this[object text] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
object | text | The text of the value to get or set. |
Property Value
Type | Description |
---|---|
TValue |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
this[string]
Gets or sets the value associated with the specified text.
Declaration
public virtual TValue this[string text] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
string | text | The text of the value to get or set. |
Property Value
Type | Description |
---|---|
TValue |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Keys
Gets a collection containing the keys in the CharArrayDictionary<TValue>.
Declaration
public virtual CharArraySet Keys { get; }
Property Value
Type | Description |
---|---|
CharArraySet |
MatchVersion
The Lucene version corresponding to the compatibility behavior that this instance emulates
Declaration
public virtual LuceneVersion MatchVersion { get; }
Property Value
Type | Description |
---|---|
LuceneVersion |
Values
Gets a collection containing the values in the CharArrayDictionary<TValue>. This specialized collection can be enumerated in order to read its values and overrides ToString() in order to display a string representation of the values.
Declaration
public CharArrayDictionary<TValue>.ValueCollection Values { get; }
Property Value
Type | Description |
---|---|
CharArrayDictionary<TValue>.ValueCollection |
Methods
Add(ICharSequence, TValue)
Adds the value
for the passed in text
.
Declaration
public virtual void Add(ICharSequence text, TValue value)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text | The string-able type to be added/updated in the dictionary. |
TValue | value | The corresponding value for the given |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
text 's J2N.Text.ICharSequence.HasValue property returns false .
|
ArgumentException | An element with |
Add(char[], TValue)
Adds the value
for the passed in text
.
Declaration
public virtual void Add(char[] text, TValue value)
Parameters
Type | Name | Description |
---|---|---|
char[] | text | The string-able type to be added/updated in the dictionary. |
TValue | value | The corresponding value for the given |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | An element with |
Add(string, TValue)
Adds the value
for the passed in text
.
Declaration
public virtual void Add(string text, TValue value)
Parameters
Type | Name | Description |
---|---|---|
string | text | The string-able type to be added/updated in the dictionary. |
TValue | value | The corresponding value for the given |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | An element with |
Add<T>(T, TValue)
Adds the value
for the passed in text
.
Declaration
public virtual void Add<T>(T text, TValue value)
Parameters
Type | Name | Description |
---|---|---|
T | text | The string-able type to be added/updated in the dictionary. |
TValue | value | The corresponding value for the given |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | An element with |
AsReadOnly()
Returns an unmodifiable CharArrayDictionary<TValue>. This allows to provide unmodifiable views of internal dictionary for "read-only" use.
Declaration
public CharArrayDictionary<TValue> AsReadOnly()
Returns
Type | Description |
---|---|
CharArrayDictionary<TValue> | an new unmodifiable CharArrayDictionary<TValue>. |
Clear()
Clears all entries in this dictionary. This method is supported for reusing, but not Remove(TKey).
Declaration
public virtual void Clear()
ContainsKey(ICharSequence)
true
if the text
J2N.Text.ICharSequence is in the Keys;
otherwise false
Declaration
public virtual bool ContainsKey(ICharSequence text)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text |
Returns
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
text 's J2N.Text.ICharSequence.HasValue property returns false .
|
ContainsKey(char[])
true
if the entire Keys is the same as the
text
char[] being passed in;
otherwise false
.
Declaration
public virtual bool ContainsKey(char[] text)
Parameters
Type | Name | Description |
---|---|---|
char[] | text |
Returns
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ContainsKey(char[], int, int)
true
if the length
chars of text
starting at startIndex
are in the Keys
Declaration
public virtual bool ContainsKey(char[] text, int startIndex, int length)
Parameters
Type | Name | Description |
---|---|---|
char[] | text | |
int | startIndex | |
int | length |
Returns
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException |
|
ContainsKey(string)
Declaration
public virtual bool ContainsKey(string text)
Parameters
Type | Name | Description |
---|---|---|
string | text |
Returns
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ContainsKey<T>(T)
true
if the text
ToString() (in the invariant culture)
is in the Keys; otherwise false
Declaration
public virtual bool ContainsKey<T>(T text)
Parameters
Type | Name | Description |
---|---|---|
T | text |
Returns
Type | Description |
---|---|
bool |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Equals(object?)
LUCENENET Specific - test for value equality similar to how it is done in Java
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | Another dictionary to test the values of |
Returns
Type | Description |
---|---|
bool |
|
Overrides
GetEnumerator()
Returns an enumerator that iterates through the CharArrayDictionary<TValue>.
Declaration
public CharArrayDictionary<TValue>.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
CharArrayDictionary<TValue>.Enumerator | A CharArrayDictionary<TValue>.Enumerator for the CharArrayDictionary<TValue>. |
Remarks
For purposes of enumeration, each item is a KeyValuePair<TKey, TValue> structure representing a value and its text. There are also properties allowing direct access to the char[] array of each element and quick conversions to string or J2N.Text.ICharSequence.
Theforeach
statement of the C# language (for each
in C++, For Each
in Visual Basic)
hides the complexity of enumerators. Therefore, using foreach
is recommended instead of directly manipulating the enumerator.
This enumerator can be used to read the data in the collection, or modify the corresponding value at the current position.
Initially, the enumerator is positioned before the first element in the collection. At this position, the
Current property is undefined. Therefore, you must call the
MoveNext() method to advance the enumerator to the first element
of the collection before reading the value of Current.
The Current property returns the same object until
MoveNext() is called. MoveNext()
sets Current to the next element.
If MoveNext() passes the end of the collection, the enumerator is
positioned after the last element in the collection and MoveNext()
returns false
. When the enumerator is at this position, subsequent calls to MoveNext()
also return false
. If the last call to MoveNext() returned false
,
Current is undefined. You cannot set Current
to the first element of the collection again; you must create a new enumerator object instead.
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 (other than through the SetValue(TValue) method),
the enumerator is irrecoverably invalidated and the next call
to MoveNext() or Reset() throws an
InvalidOperationException.
The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is
intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the
collection during the entire enumeration. To allow the collection to be accessed by multiple threads for
reading and writing, you must implement your own synchronization.
Default implementations of collections in the J2N.Collections.Generic namespace are not synchronized.
This method is an O(1) operation.
GetHashCode()
LUCENENET Specific - override required by .NET because we override Equals to simulate Java's value equality checking.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
Put(ICharSequence, TValue, out TValue)
Add the given mapping.
Note: The this[ICharSequence] setter is more efficient than this method if thepreviousValue
is not required.
Declaration
public virtual bool Put(ICharSequence text, TValue value, out TValue previousValue)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text | A text with which the specified |
TValue | value | The value to be associated with the specified |
TValue | previousValue | The previous value associated with the text, or the default for the type of |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
text 's J2N.Text.ICharSequence.HasValue property returns false .
|
Put(char[], int, int, TValue, out TValue)
Add the given mapping.
If ignoreCase is true
for this dictionary, the text array will be directly modified.
previousValue
is not required.
Declaration
public virtual bool Put(char[] text, int startIndex, int length, TValue value, out TValue previousValue)
Parameters
Type | Name | Description |
---|---|---|
char[] | text | A text with which the specified |
int | startIndex | The position of the |
int | length | The total length of the |
TValue | value | The value to be associated with the specified |
TValue | previousValue | The previous value associated with the text, or the default for the type of |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException |
|
Put(char[], TValue, out TValue)
Add the given mapping.
If ignoreCase is true
for this dictionary, the text array will be directly modified.
The user should never modify this text array after calling this method.
previousValue
is not required.
Declaration
public virtual bool Put(char[] text, TValue value, out TValue previousValue)
Parameters
Type | Name | Description |
---|---|---|
char[] | text | A text with which the specified |
TValue | value | The value to be associated with the specified |
TValue | previousValue | The previous value associated with the text, or the default for the type of |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Put(string, TValue, out TValue)
Add the given mapping.
Note: The this[string] setter is more efficient than this method if thepreviousValue
is not required.
Declaration
public virtual bool Put(string text, TValue value, out TValue previousValue)
Parameters
Type | Name | Description |
---|---|---|
string | text | A text with which the specified |
TValue | value | The value to be associated with the specified |
TValue | previousValue | The previous value associated with the text, or the default for the type of |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
PutAll(IDictionary<ICharSequence, TValue>)
This implementation enumerates over the specified IDictionary{ICharSequence,TValue}'s entries, and calls this dictionary's Set(ICharSequence, TValue) operation once for each entry.
Declaration
public virtual void PutAll(IDictionary<ICharSequence, TValue> collection)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<ICharSequence, TValue> | collection | A dictionary of values to add/update in the current dictionary. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
null text.
-or-
The text's J2N.Text.ICharSequence.HasValue property for a given element in the collection returns false .
|
PutAll(IDictionary<char[], TValue>)
This implementation enumerates over the specified IDictionary{char[],TValue}'s entries, and calls this dictionary's Set(char[], TValue) operation once for each entry.
If ignoreCase istrue
for this dictionary, the text arrays will be directly modified.
The user should never modify the text arrays after calling this method.
Declaration
public virtual void PutAll(IDictionary<char[], TValue> collection)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<char[], TValue> | collection | A dictionary of values to add/update in the current dictionary. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
null .
|
PutAll(IDictionary<string, TValue>)
This implementation enumerates over the specified IDictionary{string,TValue}'s entries, and calls this dictionary's Set(string, TValue) operation once for each entry.
Declaration
public virtual void PutAll(IDictionary<string, TValue> collection)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<string, TValue> | collection | A dictionary of values to add/update in the current dictionary. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
null .
|
PutAll(IEnumerable<KeyValuePair<ICharSequence, TValue>>)
This implementation enumerates over the specified IEnumerable{KeyValuePair{ICharSequence,TValue}}'s entries, and calls this dictionary's Set(ICharSequence, TValue) operation once for each entry.
Declaration
public virtual void PutAll(IEnumerable<KeyValuePair<ICharSequence, TValue>> collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyValuePair<ICharSequence, TValue>> | collection | The values to add/update in the current dictionary. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
null text.
-or-
The text's J2N.Text.ICharSequence.HasValue property for a given element in the collection returns false .
|
PutAll(IEnumerable<KeyValuePair<char[], TValue>>)
This implementation enumerates over the specified IEnumerable{KeyValuePair{char[],TValue}}'s entries, and calls this dictionary's Set(char[], TValue) operation once for each entry.
Declaration
public virtual void PutAll(IEnumerable<KeyValuePair<char[], TValue>> collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyValuePair<char[], TValue>> | collection | The values to add/update in the current dictionary. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
null .
|
PutAll(IEnumerable<KeyValuePair<string, TValue>>)
This implementation enumerates over the specified IEnumerable{KeyValuePair{string,TValue}}'s entries, and calls this dictionary's Set(string, TValue) operation once for each entry.
Declaration
public virtual void PutAll(IEnumerable<KeyValuePair<string, TValue>> collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyValuePair<string, TValue>> | collection | The values to add/update in the current dictionary. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
null .
|
PutAll<T>(IDictionary<T, TValue>)
This implementation enumerates over the specified IDictionary{T,TValue}'s entries, and calls this dictionary's Set<T>(T, TValue) operation once for each entry.
Declaration
public virtual void PutAll<T>(IDictionary<T, TValue> collection)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<T, TValue> | collection | A dictionary of values to add/update in the current dictionary. |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
null .
|
PutAll<T>(IEnumerable<KeyValuePair<T, TValue>>)
This implementation enumerates over the specified IEnumerable{KeyValuePair{TKey,TValue}}'s entries, and calls this dictionary's Set<T>(T, TValue) operation once for each entry.
Declaration
public virtual void PutAll<T>(IEnumerable<KeyValuePair<T, TValue>> collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyValuePair<T, TValue>> | collection | The values to add/update in the current dictionary. |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
null .
|
Put<T>(T, TValue, out TValue)
Add the given mapping using the ToString() representation
of text
in the InvariantCulture.
previousValue
is not required.
Declaration
public virtual bool Put<T>(T text, TValue value, out TValue previousValue)
Parameters
Type | Name | Description |
---|---|---|
T | text | A text with which the specified |
TValue | value | The value to be associated with the specified |
TValue | previousValue | The previous value associated with the text, or the default for the type of |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToCharArrayDictionary()
Returns a copy of the current CharArrayDictionary<TValue> as a new instance of CharArrayDictionary<TValue>.
Preserves the value of matchVersion
and ignoreCase
from the current instance.
Declaration
public virtual CharArrayDictionary<TValue> ToCharArrayDictionary()
Returns
Type | Description |
---|---|
CharArrayDictionary<TValue> | A copy of the current CharArrayDictionary<TValue> as a CharArrayDictionary<TValue>. |
ToCharArrayDictionary(LuceneVersion)
Returns a copy of the current CharArrayDictionary<TValue> as a new instance of CharArrayDictionary<TValue>
using the specified matchVersion
value. Preserves the value of ignoreCase
from the current instance.
Declaration
public virtual CharArrayDictionary<TValue> ToCharArrayDictionary(LuceneVersion matchVersion)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | compatibility match version see Version note above for details. |
Returns
Type | Description |
---|---|
CharArrayDictionary<TValue> | A copy of the current CharArrayDictionary<TValue> as a CharArrayDictionary<TValue>. |
ToCharArrayDictionary(LuceneVersion, bool)
Returns a copy of the current CharArrayDictionary<TValue> as a new instance of CharArrayDictionary<TValue>
using the specified matchVersion
and ignoreCase
values.
Declaration
public virtual CharArrayDictionary<TValue> ToCharArrayDictionary(LuceneVersion matchVersion, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | compatibility match version see Version note above for details. |
bool | ignoreCase |
|
Returns
Type | Description |
---|---|
CharArrayDictionary<TValue> | A copy of the current CharArrayDictionary<TValue> as a CharArrayDictionary<TValue>. |
ToString()
Returns a string that represents the current object. (Inherited from object.)
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
TryGetValue(ICharSequence, out TValue)
Gets the value associated with the specified text.
Declaration
public virtual bool TryGetValue(ICharSequence text, out TValue value)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text | The text of the value to get. |
TValue | value | When this method returns, contains the value associated with the specified text, if the text is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
text 's J2N.Text.ICharSequence.HasValue property returns false .
|
TryGetValue(char[], int, int, out TValue)
Gets the value associated with the specified text.
Declaration
public virtual bool TryGetValue(char[] text, int startIndex, int length, out TValue value)
Parameters
Type | Name | Description |
---|---|---|
char[] | text | The text of the value to get. |
int | startIndex | The position of the |
int | length | The total length of the |
TValue | value | When this method returns, contains the value associated with the specified text, if the text is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException |
|
TryGetValue(char[], out TValue)
Gets the value associated with the specified text.
Declaration
public virtual bool TryGetValue(char[] text, out TValue value)
Parameters
Type | Name | Description |
---|---|---|
char[] | text | The text of the value to get. |
TValue | value | When this method returns, contains the value associated with the specified text, if the text is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TryGetValue(string, out TValue)
Gets the value associated with the specified text.
Declaration
public virtual bool TryGetValue(string text, out TValue value)
Parameters
Type | Name | Description |
---|---|---|
string | text | The text of the value to get. |
TValue | value | When this method returns, contains the value associated with the specified text, if the text is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
TryGetValue<T>(T, out TValue)
Gets the value associated with the specified text.
Declaration
public virtual bool TryGetValue<T>(T text, out TValue value)
Parameters
Type | Name | Description |
---|---|---|
T | text | The text of the value to get. |
TValue | value | When this method returns, contains the value associated with the specified text, if the text is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|