Show / Hide Table of Contents

    Class LinkedHashMap<TKey, TValue>

    LinkedHashMap is a specialized dictionary that preserves the entry order of elements. Like a HashMap, there can be a null key, but it also guarantees that the enumeration order of the elements are the same as insertion order, regardless of the number of add/remove/update operations that are performed on it.

    Inheritance
    System.Object
    HashMap<TKey, TValue>
    LinkedHashMap<TKey, TValue>
    Implements
    IDictionary<TKey, TValue>
    Inherited Members
    HashMap<TKey, TValue>.ContainsValue(TValue)
    HashMap<TKey, TValue>.AddIfAbsent(TKey, TValue)
    HashMap<TKey, TValue>.Equals(Object)
    HashMap<TKey, TValue>.GetHashCode()
    HashMap<TKey, TValue>.ToString()
    HashMap<TKey, TValue>.GetEnumerator()
    HashMap<TKey, TValue>.Add(KeyValuePair<TKey, TValue>)
    HashMap<TKey, TValue>.Clear()
    HashMap<TKey, TValue>.Contains(KeyValuePair<TKey, TValue>)
    HashMap<TKey, TValue>.CopyTo(KeyValuePair<TKey, TValue>[], Int32)
    HashMap<TKey, TValue>.Remove(KeyValuePair<TKey, TValue>)
    HashMap<TKey, TValue>.Count
    HashMap<TKey, TValue>.IsReadOnly
    HashMap<TKey, TValue>.ContainsKey(TKey)
    HashMap<TKey, TValue>.Add(TKey, TValue)
    HashMap<TKey, TValue>.Remove(TKey)
    HashMap<TKey, TValue>.TryGetValue(TKey, TValue)
    HashMap<TKey, TValue>.Item[TKey]
    HashMap<TKey, TValue>.Keys
    HashMap<TKey, TValue>.Values
    Namespace: Lucene.Net.Support
    Assembly: Lucene.Net.dll
    Syntax
    public class LinkedHashMap<TKey, TValue> : HashMap<TKey, TValue>, IDictionary<TKey, TValue>
    Type Parameters
    Name Description
    TKey

    The type of keys in the dictionary

    TValue

    The type of values in the dictionary

    Remarks

    Unordered Dictionaries

    • - use when order is not important and all keys are non-null.
    • HashMap<TKey, TValue> - use when order is not important and support for a null key is required.

    Ordered Dictionaries

    • LinkedHashMap<TKey, TValue> - use when you need to preserve entry insertion order. Keys are nullable.
    • - use when you need natural sort order. Keys must be unique.
    • TreeDictionary<TKey, TValue> - use when you need natural sort order. Keys are nullable.
    • LurchTable<TKey, TValue> - use when you need to sort by most recent access or most recent update. Works well for LRU caching.

    Constructors

    | Improve this Doc View Source

    LinkedHashMap()

    Declaration
    public LinkedHashMap()
    | Improve this Doc View Source

    LinkedHashMap(IEnumerable<KeyValuePair<TKey, TValue>>)

    Declaration
    public LinkedHashMap(IEnumerable<KeyValuePair<TKey, TValue>> source)
    Parameters
    Type Name Description
    IEnumerable<KeyValuePair<TKey, TValue>> source
    | Improve this Doc View Source

    LinkedHashMap(IEnumerable<KeyValuePair<TKey, TValue>>, IEqualityComparer<TKey>)

    Declaration
    public LinkedHashMap(IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey> comparer)
    Parameters
    Type Name Description
    IEnumerable<KeyValuePair<TKey, TValue>> source
    IEqualityComparer<TKey> comparer
    | Improve this Doc View Source

    LinkedHashMap(IEqualityComparer<TKey>)

    Declaration
    public LinkedHashMap(IEqualityComparer<TKey> comparer)
    Parameters
    Type Name Description
    IEqualityComparer<TKey> comparer
    | Improve this Doc View Source

    LinkedHashMap(Int32)

    Declaration
    public LinkedHashMap(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity
    | Improve this Doc View Source

    LinkedHashMap(Int32, IEqualityComparer<TKey>)

    Declaration
    public LinkedHashMap(int capacity, IEqualityComparer<TKey> comparer)
    Parameters
    Type Name Description
    System.Int32 capacity
    IEqualityComparer<TKey> comparer

    Properties

    | Improve this Doc View Source

    Count

    Declaration
    public override int Count { get; }
    Property Value
    Type Description
    System.Int32
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Count
    | Improve this Doc View Source

    IsReadOnly

    Declaration
    public override bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.IsReadOnly
    | Improve this Doc View Source

    Item[TKey]

    Declaration
    public override TValue this[TKey key] { get; set; }
    Parameters
    Type Name Description
    TKey key
    Property Value
    Type Description
    TValue
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Item[TKey]
    | Improve this Doc View Source

    Keys

    Declaration
    public override ICollection<TKey> Keys { get; }
    Property Value
    Type Description
    ICollection<TKey>
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Keys
    | Improve this Doc View Source

    Values

    Declaration
    public override ICollection<TValue> Values { get; }
    Property Value
    Type Description
    ICollection<TValue>
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Values

    Methods

    | Improve this Doc View Source

    Add(TKey, TValue)

    Declaration
    public override void Add(TKey key, TValue value)
    Parameters
    Type Name Description
    TKey key
    TValue value
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Add(TKey, TValue)
    | Improve this Doc View Source

    Add(KeyValuePair<TKey, TValue>)

    Declaration
    public override void Add(KeyValuePair<TKey, TValue> item)
    Parameters
    Type Name Description
    KeyValuePair<TKey, TValue> item
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Add(KeyValuePair<TKey, TValue>)
    | Improve this Doc View Source

    Clear()

    Declaration
    public override void Clear()
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Clear()
    | Improve this Doc View Source

    Contains(KeyValuePair<TKey, TValue>)

    Declaration
    public override bool Contains(KeyValuePair<TKey, TValue> item)
    Parameters
    Type Name Description
    KeyValuePair<TKey, TValue> item
    Returns
    Type Description
    System.Boolean
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Contains(KeyValuePair<TKey, TValue>)
    | Improve this Doc View Source

    ContainsKey(TKey)

    Declaration
    public override bool ContainsKey(TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    System.Boolean
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.ContainsKey(TKey)
    | Improve this Doc View Source

    CopyTo(KeyValuePair<TKey, TValue>[], Int32)

    Declaration
    public override void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
    Parameters
    Type Name Description
    KeyValuePair<TKey, TValue>[] array
    System.Int32 arrayIndex
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.CopyTo(KeyValuePair<TKey, TValue>[], System.Int32)
    | Improve this Doc View Source

    GetEnumerator()

    Declaration
    public override IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
    Returns
    Type Description
    IEnumerator<KeyValuePair<TKey, TValue>>
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.GetEnumerator()
    | Improve this Doc View Source

    Remove(TKey)

    Declaration
    public override bool Remove(TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    System.Boolean
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Remove(TKey)
    | Improve this Doc View Source

    Remove(KeyValuePair<TKey, TValue>)

    Declaration
    public override bool Remove(KeyValuePair<TKey, TValue> item)
    Parameters
    Type Name Description
    KeyValuePair<TKey, TValue> item
    Returns
    Type Description
    System.Boolean
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.Remove(KeyValuePair<TKey, TValue>)
    | Improve this Doc View Source

    TryGetValue(TKey, out TValue)

    Declaration
    public override bool TryGetValue(TKey key, out TValue value)
    Parameters
    Type Name Description
    TKey key
    TValue value
    Returns
    Type Description
    System.Boolean
    Overrides
    Lucene.Net.Support.HashMap<TKey, TValue>.TryGetValue(TKey, TValue)

    Implements

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