brl_map.md 2.0 KB


id: brl.map title: BRL.Map

sidebar_label: BRL.Map

Types

Type Description
TIntKey Int holder for key returned by TIntMap.Keys() enumerator.
TPtrKey Byte Ptr holder for key returned by TPtrMap.Keys() enumerator.

Functions

Function CreateMap:TMap()

Create a map

Returns

A new map object

Function ClearMap( map:TMap )

Clear a map

ClearMap removes all keys and values from map

Function MapIsEmpty( map:TMap )

Check if a map is empty

Returns

True if map is empty, otherwise false

Function MapInsert( map:TMap,key:Object,value:Object )

Insert a key/value pair into a map

If map already contained key, it's value is overwritten with value.

Function MapValueForKey:Object( map:TMap,key:Object )

Find a value given a key

If map does not contain key, a Null object is returned.

Returns

The value associated with key

Function MapContains( map:TMap,key:Object )

Check if a map contains a key

Returns

True if map contains key

Function MapRemove( map:TMap,key:Object )

Remove a key/value pair from a map

Function MapKeys:TMapEnumerator( map:TMap )

Get map keys

The object returned by MapKeys can be used with EachIn to iterate through the keys in map.

Returns

An iterator object

Function MapValues:TMapEnumerator( map:TMap )

Get map values

The object returned by MapValues can be used with EachIn to iterate through the values in map.

Returns

An iterator object

Function CopyMap:TMap( map:TMap )

Copy a map

Returns

A copy of map