Map.getEnumerator Method

Creates an enumerator for the map which allows you to traverse the map.

Syntax

public MapEnumerator getEnumerator()

Run On

Called

Return Value

Type: MapEnumerator Class
A MapEnumerator object for the map.

Examples

The following example checks whether the _from map has any elements, and it creates an enumerator for the map if it has any elements. The map is then traversed, and the elements within it are inserted into the _to map.

static void mergeRecsPrim( 
    Map _from, 
    Map _to 
    ) 
{ 
    MapEnumerator   me; 
  
    if (! _from) 
    { 
        return; 
    } 
 
    if (! _from.elements()) 
    { 
        return; 
    } 
 
    me = _from.getEnumerator(); 
    while (me.moveNext()) 
    { 
        _to.insert(me.currentKey(),me.currentValue()); 
    } 
}

See Also

Map Class

MapEnumerator Class