Home

MultiMap<K:Compare,V>

Binary tree that holds multiple values with the same key

Operations

New

Default constructor

New()

Each

Function called for each element

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

Empty

Clears the set

method : public : Empty() ~ Nil

Filter

Uses the given function to filter out values

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

Return
TypeDescription
MultiMap<K,V>filter vector

Find

Checks for a value in a map

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

Return
TypeDescription
Vector<V>true if found, false otherwise

GetKeys

Get a collection of keys

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

GetValues

Gets a collection of values

method : public : GetValues() ~ Vector
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 queue is empty

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

Remove

Removes a set of values from the map

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

Size

Size of unique keys

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

TotalSize

Size of values

method : public : TotalSize() ~ Int
Return
TypeDescription
Intsize of values