Aardvark.Base


SymbolDict<'TValue>

A SymbolDict is an alternate implementation of a Dictionary that can optionally act as a stack for all items with the same key. It is implemented as a hashtable with external linking, that uses primes as the table size in order to reduce the danger of funneling.

Constructors

ConstructorDescription
new(stackDuplicateKeys)
Signature: stackDuplicateKeys:bool -> unit

Create a SymbolDict that autmatically grows and shrinks as necessary. If the optional parameter stackDuplicateKeys is set to true, the SymbolDict acts as a stack for all items with the same key.

new(initialCapacity)
Signature: initialCapacity:int -> unit

Create a SymbolDict that autmatically grows and shrinks as necessary, but also specify an initial capacity. If the optional parameter stackDuplicateKeys is set to true, the SymbolDict acts as a stack for all items with the same key.

new(initialCapacity, stackDuplicateKeys)
Signature: (initialCapacity:int * stackDuplicateKeys:bool) -> unit

Create a SymbolDict that autmatically grows and shrinks as necessary, but also specify an initial capacity. If the optional parameter stackDuplicateKeys is set to true, the SymbolDict acts as a stack for all items with the same key.

new(items, stackDuplicateKeys)
Signature: (items:IEnumerable<KeyValuePair<Symbol,'TValue>> * stackDuplicateKeys:bool) -> unit

Create a SymbolDict and initialize it to contain the supplied items. If the optional parameter stackDuplicateKeys is set to true, the SymbolDict acts as a stack for all items with the same key.

new(items, stackDuplicateKeys)
Signature: (items:IEnumerable<KeyValuePair<string,'TValue>> * stackDuplicateKeys:bool) -> unit

Create a SymbolDict and initialize to contain the supplied items. Note hat this incurs the overhead of converting all string keys to symbols. If the optional parameter stackDuplicateKeys is set to true, the SymbolDict acts as a stack for all items with the same key.

Instance members

Instance memberDescription
Add(key, value)
Signature: (key:Symbol * value:'TValue) -> unit
Modifiers: abstract

Add the item with the supplied key and the supplied value to the SymbolDict.

Add(key, value)
Signature: (key:string * value:'TValue) -> unit

Adds the supplied item to the SymbolDict. Note that this incurs the overhead of converting the string key to a symbol.

Add(item)
Signature: item:KeyValuePair<string,'TValue> -> unit

Add the supplied item to the SymbolDict. Note that this incurs the overhead of converting the string key to a symbol.

Add(item)
Signature: item:KeyValuePair<Symbol,'TValue> -> unit
Modifiers: abstract

Add the supplied item to the SymbolDict.

Add(key, value)
Signature: (key:TypedSymbol<'TType> * value:'TType) -> unit
AddObject(objkey, objvalue)
Signature: (objkey:obj * objvalue:obj) -> unit
Modifiers: abstract

Add the item with supplied key and the supplied value both supplied as generic objects, to the SymbolDict. Note that the supplied key and value are cast to the concrete type of the keys and values used in the SymbolDict and this will fail if they are of different types.

AddRange(items)
Signature: items:IEnumerable<KeyValuePair<Symbol,'TValue>> -> unit

Add the supplied items to the SymbolDict.

AsConcurrent()
Signature: unit -> ConcurrentSymbolDict<'TValue>

Retuns a concurrent wrapper around the SymbolDict to enable concurrent modifications.

Clear()
Signature: unit -> unit
Modifiers: abstract

Remove all items. Capacity remains unchanged.

Contains(key)
Signature: key:Symbol -> bool

Returns true if the SymbolDict contains the item with the supplied key.

Contains(key, value)
Signature: (key:Symbol * value:'TValue) -> bool

Returns true if the SymbolDict contains the item with the supplied key and the supplied value.

Contains(item)
Signature: item:KeyValuePair<Symbol,'TValue> -> bool
Modifiers: abstract

Returns true if the SymbolDict contains the item with the supplied KeyValuePair.

Contains(key)
Signature: key:TypedSymbol<'TType> -> bool
ContainsKey(key)
Signature: key:Symbol -> bool
Modifiers: abstract

Returns true if the SymbolDict contains the item with the supplied key.

ContainsKey(key)
Signature: key:TypedSymbol<'TType> -> bool
CopyKeysTo(array, index)
Signature: (array:Symbol [] * index:int) -> unit

Copies all keys in the dictionary to the supplied array starting at the supplied index.

CopyTo(array, index)
Signature: (array:KeyValuePair<Symbol,'TValue> [] * index:int) -> unit
Modifiers: abstract

Copies all KeyValuePairs in the dictionary into the supplied array starting at the supplied index.

CopyTo(array, index)
Signature: (array:Array * index:int) -> unit
Modifiers: abstract

Copy items into supplied array starting at supplied index.

CopyValuesTo(array, index)
Signature: (array:'TValue [] * index:int) -> unit

Copies all values in the dictionary to the supplied array starting at the supplied index.

Count
Signature: int
Modifiers: abstract

Returns the number of items currently contained in the SymbolDict.

Get(key)
Signature: key:Symbol -> 'TValue

Get the element with the supplied key. Throws an exception if the element is not found. This is an alias of the indexer.

Get(key, defaultValue)
Signature: (key:Symbol * defaultValue:'TValue) -> 'TValue

Get the element with the supplied key. Returns the supplied default value if the element is not found.

Get(key)
Signature: key:TypedSymbol<'TType> -> 'TType
Get(key, defaultValue)
Signature: (key:TypedSymbol<'TType> * defaultValue:'TType) -> 'TType
GetAndRemove(key)
Signature: key:Symbol -> 'TValue

Remove the item with the supplied key from the SymbolDict and return it. If multipe entries have the same key, the one that was inserted last is removed. If the item is not found, a KeyNotFoundException is thrown.

GetAs(key)
Signature: key:Symbol -> 'TType
GetAs(key, defaultValue)
Signature: (key:Symbol * defaultValue:'TType) -> 'TType
GetAsOrDefault(key)
Signature: key:Symbol -> 'TType
GetEnumerator()
Signature: unit -> IEnumerator<KeyValuePair<Symbol,'TValue>>
Modifiers: abstract
GetOrCreate(key, creator)
Signature: (key:Symbol * creator:Func<Symbol,'TValue>) -> 'TValue

Get the element with the supplied key. If the element is not found, the supplied creator is called to create a new element that is added to the SymbolDict and returned.

GetOrDefault(key)
Signature: key:Symbol -> 'TValue

Get the element with the supplied key. Returns the default value of the value type if the element is not found.

GetOrDefault(key)
Signature: key:TypedSymbol<'TType> -> 'TType
IsReadOnly
Signature: bool
Modifiers: abstract

Always returns false. Part of the ICollection implementation.

IsSynchronized
Signature: bool
Modifiers: abstract
[()]
Signature: unit -> Symbol
Modifiers: abstract

Get or set the item with the supplied key. If multiple items with the same key are allowed, the SymbolDict acts as a stack.

Items
Signature: IEnumerable<KeyValuePair<Symbol,'TValue>>
Keys
Signature: IEnumerable<Symbol>
Modifiers: abstract

Returns all keys in the dictionary.

KeysToArray()
Signature: unit -> Symbol []

Returns all keys in the dictionary as an array.

KeyType
Signature: Type
Modifiers: abstract
KeyValuePairs
Signature: IEnumerable<KeyValuePair<Symbol,'TValue>>
Modifiers: abstract

Returns all key value pairs in the SymbolDict.

KeyValuePairsForStorage
Signature: IEnumerable<KeyValuePair<Symbol,'TValue>>

Returns all key value pairs in the SymbolDict, in such a way, that the stack order is correct when the pairs are put into a new SymbolDict in the order they are returned.

LongCount
Signature: int64
Modifiers: abstract

Returns the number of items currently contained in the SymbolDict as long.

MaxFillFactor()
Signature: unit -> unit

Setting the maximal fill factor makes it possible to fine-tune the performance for certain applications. Normally this should not be necessary.

MinFillFactor()
Signature: unit -> unit

Setting the minimal fill factor makes it possible to influence the shrinking behaviour of the SymbolDict. Normally this should be set to a quater of the maximal fill factor. In order to completely prevent shrinking it can also be set to 0.0f.

ObjectPairs
Signature: IEnumerable<Pair<obj>>
Modifiers: abstract
Remove(key)
Signature: key:Symbol -> bool
Modifiers: abstract

Try to remove the item with the supplied key from the SymbolDict. and return true if it was succesfully removed. If multipe entries have the same key, the one that was inserted last is removed. If the item is not found, false is returned.

Remove(key, value)
Signature: (key:Symbol * value:'TValue) -> bool

Remove the item with the supplied key and the supplied value from the SymbolDict. Returns true if the value was removed.

Remove(item)
Signature: item:KeyValuePair<Symbol,'TValue> -> bool
Modifiers: abstract

Remove the item with the supplied KeyValuePair from the SymbolDict. If the item is not found, a KeyNotFoundException is thrown.

Remove(key)
Signature: key:TypedSymbol<'TType> -> bool
Set(key, value)
Signature: (key:TypedSymbol<'TType> * value:'TType) -> unit
SyncRoot
Signature: obj
Modifiers: abstract
ToArray()
Signature: unit -> KeyValuePair<Symbol,'TValue> []

Returns all KeyValuePairs in the dictionary as an array.

TryAdd(key, value)
Signature: (key:Symbol * value:'TValue) -> bool

Add the item with the supplied key and the supplied value to the SymbolDict.

TryGetValue(key, value)
Signature: (key:Symbol * value:byref<'TValue>) -> bool
Modifiers: abstract

Try to retrieve the value with the supplied key, return true if successful and return the value via the out parameter.

TryGetValue(key, value)
Signature: (key:TypedSymbol<'TType> * value:byref<'TType>) -> bool
TryRemove(key, value)
Signature: (key:Symbol * value:byref<'TValue>) -> bool

Try to reomve the item with the supplied key. If multipe entries have the same key, the one that was inserted last is removed. Returns true if the item was found, which is returned via the out parameter.

TryRemove(key, value)
Signature: (key:Symbol * value:'TValue) -> bool

Try to reomve the item with the supplied key and the supplied value. If multipe entries match, the one that was inserted last is removed. Returns true if the item was found.

Values
Signature: IEnumerable<'TValue>
Modifiers: abstract

Returns all values in the SymbolDict.

ValuesToArray()
Signature: unit -> 'TValue []

Returns all values in the dictionary as an array.

ValuesWithKey(key)
Signature: key:Symbol -> IEnumerable<'TValue>

Return all the value with the given key. This method is only useful if multiple item with the same key are allowed.

ValueType
Signature: Type
Modifiers: abstract
ValueWithKeySkip(key, skip)
Signature: (key:Symbol * skip:int) -> 'TValue

Return the value with the given key, but skip a supplied number of entries with this key. This method is only useful if multiple item with the same key are allowed.

Fork me on GitHub