K
- the type of the keys in this mapV
- the type of the values in this mappublic abstract class AbstractIterableMap<K,V> extends Object implements IterableMap<K,V>
IterableMap
implementation.Constructor and Description |
---|
AbstractIterableMap() |
Modifier and Type | Method and Description |
---|---|
MapIterator<K,V> |
mapIterator()
Obtains a
MapIterator over the map. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
containsKey, containsValue, entrySet, get, isEmpty, keySet, remove, size, values
public AbstractIterableMap()
public MapIterator<K,V> mapIterator()
MapIterator
over the map.
A map iterator is an efficient way of iterating over maps. There is no need to access the entry set or use Map Entry objects.
IterableMap<String,Integer> map = new HashedMap<String,Integer>(); MapIterator<String,Integer> it = map.mapIterator(); while (it.hasNext()) { String key = it.next(); Integer value = it.getValue(); it.setValue(value + 1); }
mapIterator
in interface IterableGet<K,V>
Copyright © 2001–2018 The Apache Software Foundation. All rights reserved.