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