All Bundles

Map<K:Compare,V>

Balanced tree of generics

Operations

New

Default constructor

New()

Each

Function called for each element

method : public : Each(f:(K,V)~Nil) ~ Map<K,V>
Parameters
NameTypeDescription
f(K,V)~Nilfunction called

Empty

Clears the map

method : public : Empty() ~ Nil

Filter

Uses the given function to filter out values

method : public : Filter(f:(K)~Bool) ~ Map<K,V>
Parameters
NameTypeDescription
f(K)~Boolfunction to use a filter. If the function evaluates to true the value is added to the collection.

Return
TypeDescription
Map<K,V>filtered map

Find

Searches for a value in a map

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

Return
TypeDescription
Vfound value, Nil if not found

GetKeyValues

Get a collection of keys

method : public : GetKeyValues() ~ Collection.Vector<Pair<K,V>>
Return
TypeDescription
Vector<Pair<K,V>>vector of keys

GetKeys

Get a collection of keys

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

GetValues

Gets a collection of values

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

Has

Checks for a value in a map

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

Return
TypeDescription
Booltrue if found, false otherwise

Insert

Inserts a value into the map

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

IsEmpty

Checks to see if the map is empty

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

Remove

Removes a value from the map

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

Size

Size of queue

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

Zip

Creates a map from a vector of keys and values

function : Zip(keys:CompareVector<K>, values:Vector<V>) ~ Map<K,V>
Parameters
NameTypeDescription
keysCompareVector<K>keys
valuesVector<V>values

Return
TypeDescription
Map<K,V>map of key/value pairs