cds.util
Interface TreeHashMapIterator

All Known Implementing Classes:
TreeHashMap.TreeIterator

public interface TreeHashMapIterator

Interface defining the behavior of iterators specialized to browse TreeHashMap objects.

Version:
1.0 April 2003
Author:
Marc Wenger

Method Summary
 boolean hasNext()
          Returns true if there is another element
 boolean isNode()
          Returns true if the current item is a node and false if it is a leaf.
 java.lang.String key()
          Returns the key nameof the current item, the one which was called by a previous next() or nextKey() method.
 int level()
          Returns the level of the current item.
 java.util.Map.Entry next()
          Returns the next item in the TreeHashMap.
 java.lang.String nextKey()
          Returns the key (always a string) of the 'next item'.
 java.lang.String path()
          Returns the path of the current item, from its root.
 java.lang.Object value()
          Returns the value of the current item, the one which was called by a previous next() or nextKey() method.
 

Method Detail

hasNext

public boolean hasNext()
Returns true if there is another element


next

public java.util.Map.Entry next()
Returns the next item in the TreeHashMap. Depending on the definition of the iterator, it can return a leaf or a node. Consecutive next() methods return consecutive elements.


nextKey

public java.lang.String nextKey()
Returns the key (always a string) of the 'next item'. Consecutive nextKey() methods return consecutive elements.


key

public java.lang.String key()
Returns the key nameof the current item, the one which was called by a previous next() or nextKey() method. Consecutive calls to this method will return the same key name.


value

public java.lang.Object value()
Returns the value of the current item, the one which was called by a previous next() or nextKey() method. Consecutive calls to this method will return the same value.


isNode

public boolean isNode()
Returns true if the current item is a node and false if it is a leaf.


level

public int level()
Returns the level of the current item. The root, towards which the iterator was defined, has level number = 1


path

public java.lang.String path()
Returns the path of the current item, from its root.