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.
Inherited Members
Assembly: DistributedLucene.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<K, V> - use when you need natural sort order. Keys may contain duplicates.
- LurchTable<TKey, TValue> - use when you need to sort by most recent access or most recent update. Works well for LRU caching.
Constructors
Properties
Name | Description |
---|---|
Count | |
IsReadOnly | |
Item[TKey] | |
Keys | |
Values |