Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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.
    Before 3.1 supplementary characters could not be lowercased correctly due to the lack of Unicode 4 support in JDK 1.4. To use instances of CharArrayDictionary<TValue> with the behavior before Lucene 3.1 pass a Lucene.Net.Util.LuceneVersion < 3.1 to the constructors.
    Inheritance
    object
    CharArrayDictionary<TValue>
    Implements
    IDictionary<string, TValue>
    ICollection<KeyValuePair<string, TValue>>
    IDictionary
    ICollection
    IReadOnlyDictionary<string, TValue>
    IReadOnlyCollection<KeyValuePair<string, TValue>>
    IEnumerable<KeyValuePair<string, TValue>>
    IEnumerable
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    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

    false if and only if the set should be case sensitive; otherwise true.

    Exceptions
    Type Condition
    ArgumentNullException

    collection is null.

    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

    false if and only if the set should be case sensitive; otherwise true.

    Exceptions
    Type Condition
    ArgumentNullException

    collection is null.

    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

    false if and only if the set should be case sensitive; otherwise true.

    Exceptions
    Type Condition
    ArgumentNullException

    collection is null.

    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

    false if and only if the set should be case sensitive; otherwise true.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    capacity is less than zero.

    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 is null.

    -or-

    The text's J2N.Text.ICharSequence.HasValue property returns false.

    this[char[]]

    Gets or sets the value associated with the specified text.

    Note: 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 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

    text is null.

    this[char[], int, int]

    Gets or sets the value associated with the specified text.

    Note: If ignoreCase is true 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 text where the target text begins.

    int length

    The total length of the text.

    Property Value
    Type Description
    TValue
    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    ArgumentOutOfRangeException

    startIndex or length is less than zero.

    ArgumentException

    startIndex and length refer to a position outside of text.

    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

    text is null.

    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

    text is null.

    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 text.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    -or-

    The text's J2N.Text.ICharSequence.HasValue property returns false.
    ArgumentException

    An element with text already exists in the dictionary.

    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 text.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    ArgumentException

    An element with text already exists in the dictionary.

    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 text.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    ArgumentException

    An element with text already exists in the dictionary.

    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 text.

    Type Parameters
    Name Description
    T
    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    ArgumentException

    An element with text already exists in the dictionary.

    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 textJ2N.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 is null.

    -or-

    The text's J2N.Text.ICharSequence.HasValue property returns false.

    ContainsKey(char[])

    true if the entire Keys is the same as the textchar[] 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

    text is null.

    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

    text is null.

    ArgumentOutOfRangeException

    startIndex or length is less than zero.

    ArgumentException

    startIndex and length refer to a position outside of text.

    ContainsKey(string)

    true if the textstring is in the Keys; otherwise false

    Declaration
    public virtual bool ContainsKey(string text)
    Parameters
    Type Name Description
    string text
    Returns
    Type Description
    bool
    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    ContainsKey<T>(T)

    true if the textToString() (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

    text is null.

    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

    true if the given object is an IDictionary{object,V} that contains the same text value pairs as the current dictionary

    Overrides
    object.Equals(object)

    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.

    The foreach 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
    object.GetHashCode()

    Put(ICharSequence, TValue, out TValue)

    Add the given mapping.

    Note: The this[ICharSequence] setter is more efficient than this method if the previousValue 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 value is associated.

    TValue value

    The value to be associated with the specified text.

    TValue previousValue

    The previous value associated with the text, or the default for the type of value parameter if there was no mapping for text.

    Returns
    Type Description
    bool

    true if the mapping was added, false if the text already existed. The previousValue will be populated if the result is false.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    -or-

    The 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.

    Note: The this[char[]] setter is more efficient than this method if the 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 value is associated.

    int startIndex

    The position of the text where the target text begins.

    int length

    The total length of the text.

    TValue value

    The value to be associated with the specified text.

    TValue previousValue

    The previous value associated with the text, or the default for the type of value parameter if there was no mapping for text.

    Returns
    Type Description
    bool

    true if the mapping was added, false if the text already existed. The previousValue will be populated if the result is false.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    ArgumentOutOfRangeException

    startIndex or length is less than zero.

    ArgumentException

    startIndex and length refer to a position outside of text.

    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.

    Note: The this[char[]] setter is more efficient than this method if the 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 value is associated.

    TValue value

    The value to be associated with the specified text.

    TValue previousValue

    The previous value associated with the text, or the default for the type of value parameter if there was no mapping for text.

    Returns
    Type Description
    bool

    true if the mapping was added, false if the text already existed. The previousValue will be populated if the result is false.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    Put(string, TValue, out TValue)

    Add the given mapping.

    Note: The this[string] setter is more efficient than this method if the previousValue 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 value is associated.

    TValue value

    The value to be associated with the specified text.

    TValue previousValue

    The previous value associated with the text, or the default for the type of value parameter if there was no mapping for text.

    Returns
    Type Description
    bool

    true if the mapping was added, false if the text already existed. The previousValue will be populated if the result is false.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    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

    collection is null.

    -or-

    An element in the collection has a 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 is true 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

    collection is null.

    -or-

    An element in the collection is 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

    collection is null.

    -or-

    An element in the collection is 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

    collection is null.

    -or-

    An element in the collection has a 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

    collection is null.

    -or-

    An element in the collection is 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

    collection is null.

    -or-

    An element in the collection is 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

    collection is null.

    -or-

    An element in the collection is 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

    collection is null.

    -or-

    An element in the collection is null.

    Put<T>(T, TValue, out TValue)

    Add the given mapping using the ToString() representation of text in the InvariantCulture.

    Note: The this[object] setter is more efficient than this method if the 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 value is associated.

    TValue value

    The value to be associated with the specified text.

    TValue previousValue

    The previous value associated with the text, or the default for the type of value parameter if there was no mapping for text.

    Returns
    Type Description
    bool

    true if the mapping was added, false if the text already existed. The previousValue will be populated if the result is false.

    Type Parameters
    Name Description
    T
    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    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

    false if and only if the set should be case sensitive otherwise true.

    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
    object.ToString()

    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

    true if the CharArrayDictionary<TValue> contains an element with the specified text; otherwise, false.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    -or-

    The 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 text where the target text begins.

    int length

    The total length of the text.

    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

    true if the CharArrayDictionary<TValue> contains an element with the specified text; otherwise, false.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    ArgumentOutOfRangeException

    startIndex or length is less than zero.

    ArgumentException

    startIndex and length refer to a position outside of text.

    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

    true if the CharArrayDictionary<TValue> contains an element with the specified text; otherwise, false.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    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

    true if the CharArrayDictionary<TValue> contains an element with the specified text; otherwise, false.

    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    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

    true if the CharArrayDictionary<TValue> contains an element with the specified text; otherwise, false.

    Type Parameters
    Name Description
    T
    Exceptions
    Type Condition
    ArgumentNullException

    text is null.

    Implements

    IDictionary<TKey, TValue>
    ICollection<T>
    IDictionary
    ICollection
    IReadOnlyDictionary<TKey, TValue>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IEnumerable

    Extension Methods

    DictionaryExtensions.ToCharArrayDictionary<TValue>(IDictionary<string, TValue>, LuceneVersion)
    DictionaryExtensions.ToCharArrayDictionary<TValue>(IDictionary<string, TValue>, LuceneVersion, bool)
    EnumerableExtensions.ToCharArraySet<T>(IEnumerable<T>, LuceneVersion)
    EnumerableExtensions.ToCharArraySet<T>(IEnumerable<T>, LuceneVersion, bool)
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.