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);
}
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private Iterator | |
| private Map. | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public K | Returns: the current keyImplements org. next().
|
| public V | Returns: the current valueImplements org. next().
|
| public boolean | Returns: true if the iterator has more elementsImplements org. |
| public K | Returns: the next key in the iterationImplements org. Map.
|
| public void | remove()
Overrides default java. Implements org. Map.
|
| public void | reset()
Implements org. |
| public V | Returns: the previous valuethe new value value)Implements org. |
| public String | Returns: a string version of the iteratorOverrides java. |
| canRemove | back to summary |
|---|---|
| private boolean canRemove | |
| iterator | back to summary |
|---|---|
| private Iterator<Map. | |
| last | back to summary |
|---|---|
| private Map. | |
| map | back to summary |
|---|---|
| private final Map<K, V> map | |
| EntrySetMapIterator | back to summary |
|---|---|
| public EntrySetMapIterator(final Map<K, V> map) Constructor.
| |
| getKey | back to summary |
|---|---|
| public K getKey() Implements org. Gets the current key, which is the key returned by the last call
to
| |
| getValue | back to summary |
|---|---|
| public V getValue() Implements org. Gets the current value, which is the value associated with the last key
returned by
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements org. Checks to see if there are more entries still to be iterated.
| |
| next | back to summary |
|---|---|
| public K next() Implements org. Gets the next key from the
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Implements org. Removes the last returned key from the underlying
This method can be called once per call to
| |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Resets the state of the iterator.
| |
| setValue | back to summary |
|---|---|
| public V setValue(final V value) Implements org. Sets the value associated with the current key.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Gets the iterator as a String. | |