Show / Hide Table of Contents

    Interface IDictionary<K, V>

    A dictionary with keys of type K and values of type V. Equivalent to a finite partial map from K to V.

    Inherited Members
    ICollectionValue<KeyValuePair<K, V>>.ListenableEvents
    ICollectionValue<KeyValuePair<K, V>>.ActiveEvents
    ICollectionValue<KeyValuePair<K, V>>.CollectionChanged
    ICollectionValue<KeyValuePair<K, V>>.CollectionCleared
    ICollectionValue<KeyValuePair<K, V>>.ItemsAdded
    ICollectionValue<KeyValuePair<K, V>>.ItemInserted
    ICollectionValue<KeyValuePair<K, V>>.ItemsRemoved
    ICollectionValue<KeyValuePair<K, V>>.ItemRemovedAt
    ICollectionValue<KeyValuePair<K, V>>.IsEmpty
    ICollectionValue<KeyValuePair<K, V>>.Count
    ICollectionValue<KeyValuePair<K, V>>.CountSpeed
    ICollectionValue<KeyValuePair<K, V>>.CopyTo(KeyValuePair<K, V>[], Int32)
    ICollectionValue<KeyValuePair<K, V>>.ToArray()
    ICollectionValue<KeyValuePair<K, V>>.Apply(Action<KeyValuePair<K, V>>)
    ICollectionValue<KeyValuePair<K, V>>.Exists(Func<KeyValuePair<K, V>, Boolean>)
    ICollectionValue<KeyValuePair<K, V>>.Find(Func<KeyValuePair<K, V>, Boolean>, KeyValuePair<K, V>)
    ICollectionValue<KeyValuePair<K, V>>.All(Func<KeyValuePair<K, V>, Boolean>)
    ICollectionValue<KeyValuePair<K, V>>.Choose()
    ICollectionValue<KeyValuePair<K, V>>.Filter(Func<KeyValuePair<K, V>, Boolean>)
    IShowable.Show(System.Text.StringBuilder, Int32, IFormatProvider)
    Namespace: Lucene.Net.Support.C5
    Assembly: Lucene.Net.dll
    Syntax
    public interface IDictionary<K, V> : ICollectionValue<KeyValuePair<K, V>>, System.Collections.Generic.IEnumerable<KeyValuePair<K, V>>, IShowable, IFormattable
    Type Parameters
    Name Description
    K
    V

    Properties

    | Improve this Doc View Source

    ContainsSpeed

    The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).

    See C5.Speed for the set of symbols.

    Declaration
    Speed ContainsSpeed { get; }
    Property Value
    Type Description
    Speed

    A characterization of the speed of lookup operations (

    Contains()
    etc.) of the implementation of this dictionary.

    | Improve this Doc View Source

    EqualityComparer

    The key equalityComparer.

    Declaration
    System.Collections.Generic.IEqualityComparer<K> EqualityComparer { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEqualityComparer<K>
    | Improve this Doc View Source

    Func

    Declaration
    Func<K, V> Func { get; }
    Property Value
    Type Description
    Func<K, V>

    A delegate of type Func<, > defining the partial function from K to V give by the dictionary.

    | Improve this Doc View Source

    IsReadOnly

    Declaration
    bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean

    True if dictionary is read-only

    | Improve this Doc View Source

    Item[K]

    Indexer for dictionary.

    Declaration
    V this[K key] { get; set; }
    Parameters
    Type Name Description
    K key
    Property Value
    Type Description
    V

    The value corresponding to the key

    Exceptions
    Type Condition
    NoSuchItemException

    if no entry is found.

    | Improve this Doc View Source

    Keys

    Declaration
    ICollectionValue<K> Keys { get; }
    Property Value
    Type Description
    ICollectionValue<K>

    A collection containing all the keys of the dictionary

    | Improve this Doc View Source

    Values

    Declaration
    ICollectionValue<V> Values { get; }
    Property Value
    Type Description
    ICollectionValue<V>

    A collection containing all the values of the dictionary

    Methods

    | Improve this Doc View Source

    Add(K, V)

    Add a new (key, value) pair (a mapping) to the dictionary.

    Declaration
    void Add(K key, V val)
    Parameters
    Type Name Description
    K key

    Key to add

    V val

    Value to add

    Exceptions
    Type Condition
    DuplicateNotAllowedException

    if there already is an entry with the same key.

    | Improve this Doc View Source

    AddAll<U, W>(System.Collections.Generic.IEnumerable<KeyValuePair<U, W>>)

    Add the entries from a collection of C5.KeyValuePair`2 pairs to this dictionary.

    Declaration
    void AddAll<U, W>(System.Collections.Generic.IEnumerable<KeyValuePair<U, W>> entries)
        where U : K where W : V
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<KeyValuePair<U, W>> entries
    Type Parameters
    Name Description
    U
    W
    Exceptions
    Type Condition
    DuplicateNotAllowedException

    If the input contains duplicate keys or a key already present in this dictionary.

    | Improve this Doc View Source

    Check()

    Check the integrity of the internal data structures of this dictionary. Only available in DEBUG builds???

    Declaration
    bool Check()
    Returns
    Type Description
    System.Boolean

    True if check does not fail.

    | Improve this Doc View Source

    Clear()

    Remove all entries from the dictionary

    Declaration
    void Clear()
    | Improve this Doc View Source

    Contains(K)

    Check if there is an entry with a specified key

    Declaration
    bool Contains(K key)
    Parameters
    Type Name Description
    K key

    The key to look for

    Returns
    Type Description
    System.Boolean

    True if key was found

    | Improve this Doc View Source

    ContainsAll<H>(System.Collections.Generic.IEnumerable<H>)

    Check whether this collection contains all the values in another collection. If this collection has bag semantics (

    AllowsDuplicates==true
    ) the check is made with respect to multiplicities, else multiplicities are not taken into account.

    Declaration
    bool ContainsAll<H>(System.Collections.Generic.IEnumerable<H> items)
        where H : K
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<H> items

    The

    Returns
    Type Description
    System.Boolean

    True if all values in

    items
    is in this collection.

    Type Parameters
    Name Description
    H
    | Improve this Doc View Source

    Find(ref K, out V)

    Check if there is an entry with a specified key and report the corresponding value if found. This can be seen as a safe form of "val = this[key]".

    Declaration
    bool Find(ref K key, out V val)
    Parameters
    Type Name Description
    K key

    The key to look for

    V val

    On exit, the value of the entry

    Returns
    Type Description
    System.Boolean

    True if key was found

    | Improve this Doc View Source

    FindOrAdd(K, ref V)

    Look for a specific key in the dictionary. If found, report the corresponding value, else add an entry with the key and the supplied value.

    Declaration
    bool FindOrAdd(K key, ref V val)
    Parameters
    Type Name Description
    K key

    The key to look for

    V val

    On entry the value to add if the key is not found. On exit the value found if any.

    Returns
    Type Description
    System.Boolean

    True if key was found

    | Improve this Doc View Source

    Remove(K)

    Remove an entry with a given key from the dictionary

    Declaration
    bool Remove(K key)
    Parameters
    Type Name Description
    K key

    The key of the entry to remove

    Returns
    Type Description
    System.Boolean

    True if an entry was found (and removed)

    | Improve this Doc View Source

    Remove(K, out V)

    Remove an entry with a given key from the dictionary and report its value.

    Declaration
    bool Remove(K key, out V val)
    Parameters
    Type Name Description
    K key

    The key of the entry to remove

    V val

    On exit, the value of the removed entry

    Returns
    Type Description
    System.Boolean

    True if an entry was found (and removed)

    | Improve this Doc View Source

    Update(K, V)

    Look for a specific key in the dictionary and if found replace the value with a new one. This can be seen as a non-adding version of "this[key] = val".

    Declaration
    bool Update(K key, V val)
    Parameters
    Type Name Description
    K key

    The key to look for

    V val

    The new value

    Returns
    Type Description
    System.Boolean

    True if key was found

    | Improve this Doc View Source

    Update(K, V, out V)

    Look for a specific key in the dictionary and if found replace the value with a new one. This can be seen as a non-adding version of "this[key] = val" reporting the old value.

    Declaration
    bool Update(K key, V val, out V oldval)
    Parameters
    Type Name Description
    K key

    The key to look for

    V val

    The new value

    V oldval

    The old value if any

    Returns
    Type Description
    System.Boolean

    True if key was found

    | Improve this Doc View Source

    UpdateOrAdd(K, V)

    Update value in dictionary corresponding to key if found, else add new entry. More general than "this[key] = val;" by reporting if key was found.

    Declaration
    bool UpdateOrAdd(K key, V val)
    Parameters
    Type Name Description
    K key

    The key to look for

    V val

    The value to add or replace with.

    Returns
    Type Description
    System.Boolean

    True if key was found and value updated.

    | Improve this Doc View Source

    UpdateOrAdd(K, V, out V)

    Update value in dictionary corresponding to key if found, else add new entry. More general than "this[key] = val;" by reporting if key was found.

    Declaration
    bool UpdateOrAdd(K key, V val, out V oldval)
    Parameters
    Type Name Description
    K key

    The key to look for

    V val

    The value to add or replace with.

    V oldval

    The old value if any

    Returns
    Type Description
    System.Boolean

    True if key was found and value updated.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)