Aardvark.Base


ConcurrentLongSet

A ConcurrentLongSet is an alternate implementation of a HashSet. 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(dict)
Signature: dict:LongSet -> unit

A ConcurrentLongSet can only be concstructed by wrapping its non-concurrent counterpart.

Instance members

Instance memberDescription
Add(key)
Signature: key:int64 -> bool

Add the item with the supplied key to the ConcurrentLongSet.

AddObject(objkey)
Signature: objkey:obj -> bool

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

AddRange(keys)
Signature: keys:IEnumerable<int64> -> unit

Add the supplied keys to the ConcurrentLongSet.

Clear()
Signature: unit -> unit

Remove all items. Capacity remains unchanged.

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

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

CopyTo(array, index)
Signature: (array:int64 [] * index:int64) -> unit

Copies all keys in the dictionary to the supplied array starting at the supplied index. This may throw a ConcurrentDataModifiedException if data is modified by another task during the operation.

LongCount
Signature: int64

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

NonConcurrent
Signature: LongSet

Return the non-concurrent contained ConcurrentLongSet.

Remove(key)
Signature: key:int64 -> bool

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

ToArray()
Signature: unit -> int64 []

Returns all keys in the dictionary as an array. This may throw a ConcurrentDataModifiedException if data is modified by another task during the operation.

TryAdd(key)
Signature: key:int64 -> bool

Add the item with the supplied key to the ConcurrentLongSet.

TryRemove(key)
Signature: key:int64 -> 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.

Fork me on GitHub