Runtime Type : Types : Map

Changes Locked Out for Planned Maintenance
Page Status: Beta
Jump to: navigation, search

Stores a Collection of key-value pairs. The key can be of any type that can be cast to a Data, and the value can be either a primitive or a complex type (object). The keys must be unique, but the values need not be.

Back to Runtime Types

Contents
Inherits From

root→Object→Collection→Map

Function Summary
exists Determines whether or not a key exists in the map.
get Retrieves the value associated with the given key.
getItems Returns a Collection of MapItems containing all of the key-value pairs in the Map.
getKeyFromValue Returns the key associated with the given value. If multiple keys are associated with the specified value, then the first key found is returned.
remove Removes a single key-value pair from the Map.
removeAll Removes all key-value pairs from the Map.
set Looks for a matching key in the map of key-value pairs, and sets the associated value. If the specified key is not found, then the key-value pair is added to the Map.
Function Detail

exists

Determines whether or not a key exists in the map.

Syntax

exists( [in] Data key, [out] boolean exists )

Parameters

key
the key to search for in the map
exists
true if the key exists in the map, false otherwise

Error Handling

If key is null, then exists is false.

get

Retrieves the value associated with the given key.

Syntax

get( [in] Data key, [out] Data value )

Parameters

key
the key whose value to get
value
the value associated with the given key

Error Handling

If a matching key is not found, then the value returned is of type void, and no error condition is raised. If key is null, then value is null.

getItems

Returns a Collection of MapItems for the Map

Syntax

getItems( [out] Collection(MapItem items )

Parameters

items
the collection of MapItems 

Error Handling

 

getKeyFromValue

Returns the key associated with the given value. If multiple keys are associated with the specified value, then the first key found is returned. 

Syntax

getKeyFromValue( [in] Data value, [out] Data key )

Parameters

value
the value whose key to get
key
the key associated with the given value

Error Handling

If a matching value is not found, then the key returned is of type void, and no error condition is raised. If value is null, then key is returned as null.

remove

Removes a single key-value pair from the map.

Syntax

remove( [in] Data key )

Parameters

key
the key of the key-value pair to be removed

Error Handling

If a matching key is not found, then nothing is removed from the map, and no error condition is raised. If key is null, then nothing is removed, and no error condition is raised.

removeAll

Removes all key-value pairs from the map.

Syntax

removeAll( )

Error Handling

If the map is already empty, then no action is taken, and no error condition is raised.

set

Looks for a matching key in the map of key-value pairs, and sets the associated value. If the specified key is not found, then the key-value pair is added to the Map.

Syntax

set( [in] Data key, [in] Data value )

Parameters

key
the key to search for in the map 
value
the new value for the given key

Error Handling

If key or value is null, then no action is taken, and no error condition is raised.

    Copyright © 2005 - 2007 Bungee Labs. All rights reserved.