java.lang.Object | |
↳ | org.apache.commons.collections.iterators.EntrySetMapIterator |
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); }
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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() . | |||||||||||
Checks to see if there are more entries still to be iterated.
| |||||||||||
Gets the next key from the
Map . | |||||||||||
Removes the last returned key from the underlying
Map . | |||||||||||
Resets the state of the iterator.
| |||||||||||
Sets the value associated with the current key.
| |||||||||||
Gets the iterator as a String.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.util.Iterator
| |||||||||||
From interface
org.apache.commons.collections.MapIterator
| |||||||||||
From interface
org.apache.commons.collections.ResettableIterator
|
Gets the current key, which is the key returned by the last call
to next()
.
IllegalStateException | if next() has not yet been called
|
---|
Gets the current value, which is the value associated with the last key
returned by next()
.
IllegalStateException | if next() has not yet been called
|
---|
Checks to see if there are more entries still to be iterated.
true
if the iterator has more elements
Gets the next key from the Map
.
NoSuchElementException | if the iteration is finished |
---|
Removes the last returned key from the underlying Map
.
This method can be called once per call to next()
.
UnsupportedOperationException | if remove is not supported by the map |
---|---|
IllegalStateException | if next() has not yet been called |
IllegalStateException | if remove() has already been called
since the last call to next()
|
Resets the state of the iterator.
Sets the value associated with the current key.
value | the new value |
---|
UnsupportedOperationException | if setValue is not supported by the map |
---|---|
IllegalStateException | if next() has not yet been called |
IllegalStateException | if remove() has been called since the
last call to next()
|