brl_map.md 2.0 KB


id: brl.map title: BRL.Map

sidebar_label: Introduction

Types

Type Description
TMap An key/value (Object/Object) map backed by a Red/Black tree.

Functions

Function CreateMap:TMap()

Creates a map

Returns

A new map object


Function ClearMap( map:TMap )

Clears a map

ClearMap removes all keys and values from map


Function MapIsEmpty:Int( map:TMap )

Checks if a map is empty

Returns

True if map is empty, otherwise false


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

Inserts 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 )

Finds a value given a key

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

Returns

The value associated with key


Function MapContains:Int( map:TMap,key:Object )

Checks if a map contains a key

Returns

True if map contains key


Function MapRemove( map:TMap,key:Object )

Removes a key/value pair from a map


Function MapKeys:TMapEnumerator( map:TMap )

Gets 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 )

Gets 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 )

Copies a map

Returns

A copy of map