Class EntrySetMapIterator<K,V>

java.lang.Object
org.apache.commons.collections4.iterators.EntrySetMapIterator<K,V>
Type Parameters:
K - the type of keys
V - the type of mapped values
All Implemented Interfaces:
Iterator<K>, MapIterator<K,V>, ResettableIterator<K>

public class EntrySetMapIterator<K,V> extends Object implements MapIterator<K,V>, ResettableIterator<K>
Implements a MapIterator using a Map entrySet. Reverse iteration is not supported.
 MapIterator it = map.mapIterator();
 while (it.hasNext()) {
   Object key = it.next();
   Object value = it.getValue();
   it.setValue(newValue);
 }
 
Since:
3.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the current key, which is the key returned by the last call to next().
    Gets the current value, which is the value associated with the last key returned by next().
    boolean
    Checks to see if there are more entries still to be iterated.
    Gets the next key from the Map.
    void
    Removes the last returned key from the underlying Map.
    void
    Resets the state of the iterator.
    setValue(V value)
    Sets the value associated with the current key.
    Gets the iterator as a String.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining