From emotive
Jump to navigation Jump to search


Name MapCreate
Short Description Creates a new object of type map at run time
Class Term
Extension OTX Core library
Group Creation terms
Exceptions OutOfBoundsException
Checker Rules Core_Chk044
Standard Compliant Yes

OTL Syntax

MapTerm = MapCreate(CountableDataType, DataType, {CountableTerm1:Term1, CountableTerm2:Term2, ...});


MapCreate is a term to create a new map at run time. It is produced by passing a set of key/value pairs.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Map The newly created map


Name Data Type Class Default Cardinality Description
KeyType DataType Name - [1] Data type of the keys
ItemType DataType Name - [1] Data type of the values
MapItems - Term - [1] List of one or more key/value pairs of the respective type. No elements are specified, an empty map is generated.

OTL Examples

Map<Integer,String> result;
result = MapCreate(Integer, String, {1:"text1", 2:"text2"});
//Returns the result = {{1, "text1"}, {2, "text2"}}

See also