Share via


MapEnumerator Class

The MapEnumerator class lets you traverse through the elements in a map.

Syntax

class MapEnumerator extends Object implements Enumerator

Run On

Called

Methods

  Method Description
Gg911886.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif current This method is obsolete; use MapEnumerator.currentKey instead.
Gg911886.pubmethod(en-us,AX.60).gif currentKey Returns the key from the (key, value) pair that is currently pointed to by the enumerator.
Gg911886.pubmethod(en-us,AX.60).gif currentValue Returns the value from the (key, value) pair that is currently pointed to by the enumerator.
Gg911886.pubmethod(en-us,AX.60).gif definitionString Returns a description of the enumerator. For example, an enumerator for a map of integers to strings would return "[int -> str] enumerator".
Gg911886.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current one. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif moveNext Determines whether the enumerator points to a valid map element.
Gg911886.pubmethod(en-us,AX.60).gif new Initializes a new instance of the Object class. (Overrides the new Method.)
Gg911886.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif reset Moves the enumerator to point to just before the first element in the map.
Gg911886.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif toString Returns a string that represents the current object. (Overrides the toString Method.)
Gg911886.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg911886.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Inherited from Object.)

Top

Remarks

Map enumerators start before the first element in the list. You must call the MapEnumerator.moveNext method to make it point to the first element in the list.

It is a best practice to use the MapEnumerator class instead of the MapIterator class because enumerators are automatically created on the same tier as the map when you call the Map.getEnumerator method. Using the MapEnumerator class avoids a potential problem in code marked as Called from, where the iterator and map can end up on separate tiers. In addition, because map enumerators require less code than map iterators, they perform slightly better. The only situation where you have to use a map iterator, is when you want to delete items from a list by using the MapIterator.delete method.

Inheritance Hierarchy

Object Class
  MapEnumerator Class

See Also

Map Class

Map.getEnumerator Method

MapIterator Class