Package org.apache.commons.collections4
Interface IterableGet<K,V>
- Type Parameters:
K- the type of the keys in this mapV- the type of the values in this map
- All Superinterfaces:
Get<K,V>
- All Known Subinterfaces:
IterableMap<K,,V> IterableSortedMap<K,,V> OrderedMap<K,,V> Trie<K,V>
- All Known Implementing Classes:
AbstractBitwiseTrie,PatriciaTrie,PermutermTrie,PrefixTrie,UnmodifiableTrie
The "read" subset of the
Map interface.- Since:
- 4.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionObtains aMapIteratorover the map.Methods inherited from interface org.apache.commons.collections4.Get
containsKey, containsValue, entrySet, get, isEmpty, keySet, remove, size, values
-
Method Details
-
mapIterator
MapIterator<K,V> mapIterator()Obtains aMapIteratorover 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); }- Returns:
- a map iterator
-