Map

The Map object is an associative container. It is similar to an array or vector (e.g. Vector) in that it can store one or more objects, but has the advantage of using a dictionary system to locate objects rather than numeric indexes. You can therefore insert or lookup objects using an arbitrary value (string, integer, date, etc.) as the key (e.g. Map("foo") to reference an element by the key "foo").

 

You can create a new Map using the DOpusFactory.Map method. The keys in a map can be enumerated, and are automatically kept sorted.

 

Property Name

Return Type

Description

count

int

Returns the number of elements the Map currently holds.

empty

bool

Returns True if the Map is empty, False if not.

length

int

A synonym for count.

size

int

A synonym for count.

 

Method Name

Arguments

Return Type

Description

assign

<Map:from>

none

Copies the contents of another Map to this one.

clear

none

none

Clears the contents of the Map.

erase

<variant:key>

none

Erases the element matching the specified key, if it exists in the map.

exists

<variant:key>

bool

Returns True if the specified key exists in the map.

merge

<Map:from>

none

Merges the contents of another Map with this one.