A splay tree based dictionary implementation that provides fast access to recently visited entries and offered enumeration based on the natural ordering or comparer defined ordering of dictionary entries. More...
Classes | |
class | SplayedEntry |
Public Member Functions | |
SplayedDictionary () | |
Create a new Splayed Dictionary instance that uses a default key comparer instance to provide relative ordering of keys within the mapping. More... | |
SplayedDictionary (IComparer< K > comparer) | |
Create a new Splayed Dictionary instance that uses the give key comparer instance to provide relative ordering of keys within the mapping. More... | |
SplayedDictionary (IDictionary< K, V > source) | |
Create a new Splayed Dictionary instance that uses the give key comparer instance to provide relative ordering of keys within the mapping. More... | |
void | Add (K key, V value) |
void | Add (KeyValuePair< K, V > item) |
void | Add (object key, object value) |
virtual void | Clear () |
bool | Contains (object key) |
bool | Contains (KeyValuePair< K, V > item) |
bool | ContainsValue (V value) |
bool | ContainsKey (K key) |
virtual void | CopyTo (KeyValuePair< K, V >[] array, int arrayIndex) |
virtual void | CopyTo (Array array, int arrayIndex) |
void | Remove (object key) |
bool | Remove (K key) |
bool | RemoveValue (V target) |
Removes the first entry from the dictionary that contains the specified value and returns true, if there is no entry with the given value this method returns false. More... | |
bool | Remove (KeyValuePair< K, V > item) |
bool | TryGetValue (K key, [MaybeNullWhen(false)] out V value) |
virtual IEnumerator< KeyValuePair< K, V > > | GetEnumerator () |
Protected Member Functions | |
virtual void | EntryAdded (SplayedEntry newEntry) |
virtual void | EntryDeleted (SplayedEntry deletedEntry) |
void | Delete (SplayedEntry node) |
Protected Attributes | |
readonly RingQueue< SplayedEntry > | entryPool = new(64) |
Pooled entries used to prevent excessive allocations for rapid insert and removal operations. More... | |
SplayedEntry | root |
Root of the tree which can change as entries are splayed up and down the tree More... | |
int | size |
Tracked tree size to prevent traversals for size operations. More... | |
int | modCount |
Provides a means of tracking modification during enumeration errors. More... | |
ICollection< K > | keySet |
Cached collection object that provides access to the dictionary keys More... | |
ICollection< V > | values |
Cached collection object that provides access to the dictionary values More... | |
A splay tree based dictionary implementation that provides fast access to recently visited entries and offered enumeration based on the natural ordering or comparer defined ordering of dictionary entries.
T | The type contained in the Queue |
|
inline |
Create a new Splayed Dictionary instance that uses a default key comparer instance to provide relative ordering of keys within the mapping.
|
inline |
Create a new Splayed Dictionary instance that uses the give key comparer instance to provide relative ordering of keys within the mapping.
comparer | The IComparer instance to use to compare keys |
|
inline |
Create a new Splayed Dictionary instance that uses the give key comparer instance to provide relative ordering of keys within the mapping.
comparer | The IComparer instance to use to compare keys |
|
inline |
Removes the first entry from the dictionary that contains the specified value and returns true, if there is no entry with the given value this method returns false.
target | The value to search for in the entries |
|
protected |
Pooled entries used to prevent excessive allocations for rapid insert and removal operations.
|
protected |
Cached collection object that provides access to the dictionary keys
|
protected |
Provides a means of tracking modification during enumeration errors.
|
protected |
Root of the tree which can change as entries are splayed up and down the tree
|
protected |
Tracked tree size to prevent traversals for size operations.
|
protected |
Cached collection object that provides access to the dictionary values