org.jivesoftware.smack.util.collections
Interface IterableMap<K,V>
- All Superinterfaces:
- Map<K,V>
- All Known Implementing Classes:
- AbstractHashedMap, AbstractReferenceMap, ReferenceMap
public interface IterableMap<K,V>
- extends Map<K,V>
Defines a map that can be iterated directly without needing to create an entry set.
A map iterator is an efficient way of iterating over maps.
There is no need to access the entry set or cast to Map Entry objects.
IterableMap map = new HashedMap();
MapIterator it = map.mapIterator();
while (it.hasNext()) {
Object key = it.next();
Object value = it.getValue();
it.setValue("newValue");
}
- Since:
- Commons Collections 3.0
- Version:
- $Revision: 1.1 $ $Date: 2005/10/11 17:05:19 $
- Author:
- Matt Hall, John Watkinson, Stephen Colebourne
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
mapIterator
MapIterator<K,V> mapIterator()
- Obtains a
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 cast to Map Entry objects.
IterableMap map = new HashedMap();
MapIterator it = map.mapIterator();
while (it.hasNext()) {
Object key = it.next();
Object value = it.getValue();
it.setValue("newValue");
}
- Returns:
- a map iterator
Copyright © 2003 Jive Software.