Hash table of generics
OperationsDefault constructor
New()
Default constructor
New(capacity:Hash->Capacity)
Name | Type | Description |
---|---|---|
capacity | Hash->Capacity | capacity of hash table |
Gets the hash table capacity
method : public : Capacity() ~ Hash->Capacity
Type | Description |
---|---|
Hash->Capacity | hash table capacity |
Clears the map
method : public : Empty() ~ Nil
Searches for a value in a hash
method : public : native : Find(key:K) ~ V
Name | Type | Description |
---|---|---|
key | K | search key |
Type | Description |
---|---|
V | found value, Nil if not found |
Gets a collection of key/value pairs
method : public : GetKeyValues() ~ Vector<Pair<K,V>>
Type | Description |
---|---|
Vector<Pair<K,V>> | vector of key/value pairs |
Get a collection of keys
method : public : native : GetKeys() ~ Vector<K>
Type | Description |
---|---|
Vector<K> | vector of keys |
Gets a collection of values
method : public : native : GetValues() ~ Vector<V>
Type | Description |
---|---|
Vector<V> | vector of values |
Checks for a value in a hash
method : public : Has(key:K) ~ Bool
Name | Type | Description |
---|---|---|
key | K | search key |
Type | Description |
---|---|
Bool | true if found, false otherwise |
Inserts a value into the hash
method : public : Insert(key:K, value:V) ~ Nil
Name | Type | Description |
---|---|---|
key | K | key |
value | V | value |
Checks to see if the hash table is empty
method : public : IsEmpty() ~ Bool
Type | Description |
---|---|
Bool | true if empty, false otherwise |
Removes a value from the hash
method : public : native : Remove(key:K) ~ Bool
Name | Type | Description |
---|---|---|
key | K | key for value to remove |
Resizes the hash table
method : public : native : Resize(capacity:Hash->Capacity, auto_resize:Bool) ~ Nil
Name | Type | Description |
---|---|---|
capacity | Hash->Capacity | table capacity |
auto_resize | Bool | true for hash table auto resizing, false otherwise |
Size of map
method : public : Size() ~ Int
Type | Description |
---|---|
Int | size of map |