net.infonode.util.collection.map.base

Interface ConstMapIterator

public interface ConstMapIterator

An iterator for a map. The iterator points to a map entry when it's created so ConstMapIterator 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(); ... }

Version: $Revision: 1.3 $

Author: $Author: jesper $

Method Summary
booleanatEntry()
Returns true if the iterator points to an entry in the map.
ObjectgetKey()
Returns the key at the current map entry.
ObjectgetValue()
Returns the value at the current map entry.
voidnext()
Advance the iterator to the next entry.

Method Detail

atEntry

public 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

getKey

public Object getKey()
Returns the key at the current map entry.

Returns: the key at the current map entry

getValue

public Object getValue()
Returns the value at the current map entry.

Returns: the value at the current map entry

next

public void next()
Advance the iterator to the next entry.