Interface ConstMapIterator
-
- All Known Subinterfaces:
MapIterator
- All Known Implementing Classes:
EmptyIterator
public interface ConstMapIteratorAn iterator for a map. The iterator points to a map entry when it's created sonext()shouldn't be called at the start of the iteration.Here's an example on how to iterate over a map:
for (ConstIterator iterator = map.constIterator(); iterator.atEntry(); iterator.next()) { Object key = iterator.getKey(); Object value = iterator.getValue(); ... }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanatEntry()Returns true if the iterator points to an entry in the map.java.lang.ObjectgetKey()Returns the key at the current map entry.java.lang.ObjectgetValue()Returns the value at the current map entry.voidnext()Advance the iterator to the next entry.
-
-
-
Method Detail
-
getKey
java.lang.Object getKey()
Returns the key at the current map entry.- Returns:
- the key at the current map entry
-
getValue
java.lang.Object getValue()
Returns the value at the current map entry.- Returns:
- the value at the current map entry
-
next
void next()
Advance the iterator to the next entry.
-
atEntry
boolean atEntry()
Returns true if the iterator points to an entry in the map.- Returns:
- true if the iterator points to an entry in the map
-
-