TIntMap
A key/value (Int/Object) map.
Operators
Method Operator[]:Object(key:Int)
Finds a value given a key using index syntax.
If the map does not contain key, a Null object is returned.
Returns
The value associated with key.
Example
SuperStrict
Framework brl.standardio
Import brl.map
Local map:TIntMap = New TIntMap
map.Insert(1, "Hello")
map.Insert(2, "World")
For Local k:TIntKey = EachIn map.Keys()
Print k.value + " = " + String(map[k.value]) ' retrieve value using index operator
Next
Method Operator[]=(key:Int, value:Object)
Inserts a key/value pair into the map using index syntax.
If the map already contains key, its value is overwritten with value.
Example
SuperStrict
Framework brl.standardio
Import brl.map
Local map:TIntMap = New TIntMap
map[1] = "Hello" ' insert value using index operator
map[2] = "World"
For Local k:TIntKey = EachIn map.Keys()
Print k.value + " = " + String(map.ValueForKey(k.value))
Next
Methods
Method Clear()
Clears the map.
Removes all keys and values.
Method IsEmpty:Int()
Checks if the map is empty.
True if map is empty, otherwise False.
Method Insert( key:Int,value:Object )
Inserts a key/value pair into the map.
If the map already contains key, its value is overwritten with value.
Method Contains:Int( key:Int )
Checks if the map contains key.
Returns
True if the map contains key.
Method ValueForKey:Object( key:Int )
Finds a value given a key.
If the map does not contain key, a Null object is returned.
Returns
The value associated with key.
Method Remove:Int( key:Int )
Remove a key/value pair from the map.
Returns
True if key was removed, or False otherwise.
Method Keys:TIntMapEnumerator()
Gets the map keys.
The object returned by Keys can be used with EachIn to iterate through the keys in the map.
Returns
An enumeration object
Method Values:TIntMapEnumerator()
Get the map values.
The object returned by Values can be used with EachIn to iterate through the values in the map.
Returns
An enumeration object.
Method Copy:TIntMap()
Returns a copy the contents of this map.
Method ObjectEnumerator:TIntNodeEnumerator()
Returns a node enumeration object.
The object returned by ObjectEnumerator can be used with EachIn to iterate through the nodes in the map.