Jaa


MapIterator.next Method

Definition

Moves the iterator to the next (key, value) pair.

public:
 virtual void next();
public virtual void next ();
abstract member next : unit -> unit
override this.next : unit -> unit
Public Overridable Sub next ()

Remarks

You can use the MapIterator.more method to determine whether there are any more elements in the map.

The following example uses the next method to iterate through a map and returns a list of all the elements in the map.

static str writeMap (Map m) 
{ 
    MapIterator it = new MapIterator(m); 
    str result; 
    while (it.more()) 
    { 
        result += it.key() + '\n' + it.value() + '\n'; 
        it.next(); 
    } 
    return result; 
}

Applies to