HashTable<T>

public class HashTable<T>
Provides a simple hash table.
TType of data to store.

Properties

Count

#
public int Count { get; }
Gets the number of items stored in this hash table.

Methods

Add

#
public bool Add(Hash hash, T data)
Adds a value to the table. If a similar hash already exists, the table remains unchanged.
hash (Hash)Hash of item.
data (T)Item.
True if the item was added, false if the hash collided.

Clear

#
public void Clear()
Clear the table. This methods also resets the byte-depth constraint.

Contains

#
public bool Contains(Hash hash)
Tests whether a certain hash has been stored in this table.
hash (Hash)Hash to test for.
True if the table contains the given hash.

Overwrite

#
public void Overwrite(Hash hash, T data)
Adds a value to the table. If a similar hash already exists, the old value is overwritten.
hash (Hash)Hash of item.
data (T)Item.

Remove

#
public bool Remove(Hash hash)
Removes an item from this table.
hash (Hash)Hash to remove.
True if the item with the associated hash was removed.

TryGetValue

#
public bool TryGetValue(Hash hash, out T value)
Gets the value associated with the specified hash.
hash (Hash)Hash to search for.
value (out T)Value to retrieve.
True on success, false on failure.