All Bundles

Hash<K:Compare,V>

Hash table of generics

Operations

New

Default constructor

New()

Default constructor

New(capacity:Hash->Capacity)
Parameters
NameTypeDescription
capacityHash->Capacitycapacity of hash table

Capacity

Gets the hash table capacity

method : public : Capacity() ~ Hash->Capacity
Return
TypeDescription
Hash->Capacityhash table capacity

Empty

Clears the map

method : public : Empty() ~ Nil

Find

Searches for a value in a hash

method : public : native : Find(key:K) ~ V
Parameters
NameTypeDescription
keyKsearch key

Return
TypeDescription
Vfound value, Nil if not found

GetKeyValues

Gets a collection of key/value pairs

method : public : GetKeyValues() ~ Vector<Pair<K,V>>
Return
TypeDescription
Vector<Pair<K,V>>vector of key/value pairs

GetKeys

Get a collection of keys

method : public : native : GetKeys() ~ Vector<K>
Return
TypeDescription
Vector<K>vector of keys

GetValues

Gets a collection of values

method : public : native : GetValues() ~ Vector<V>
Return
TypeDescription
Vector<V>vector of values

Has

Checks for a value in a hash

method : public : Has(key:K) ~ Bool
Parameters
NameTypeDescription
keyKsearch key

Return
TypeDescription
Booltrue if found, false otherwise

Insert

Inserts a value into the hash

method : public : Insert(key:K, value:V) ~ Nil
Parameters
NameTypeDescription
keyKkey
valueVvalue

IsEmpty

Checks to see if the hash table is empty

method : public : IsEmpty() ~ Bool
Return
TypeDescription
Booltrue if empty, false otherwise

Remove

Removes a value from the hash

method : public : native : Remove(key:K) ~ Bool
Parameters
NameTypeDescription
keyKkey for value to remove

Resize

Resizes the hash table

method : public : native : Resize(capacity:Hash->Capacity, auto_resize:Bool) ~ Nil
Parameters
NameTypeDescription
capacityHash->Capacitytable capacity
auto_resizeBooltrue for hash table auto resizing, false otherwise

Size

Size of map

method : public : Size() ~ Int
Return
TypeDescription
Intsize of map