|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gicentre.treemappa.TreeMapBreadthFirstIterator
public class TreeMapBreadthFirstIterator
Iterates over part of a tree map hierarchy using a breadth-first traversal.
Constructor Summary | |
---|---|
TreeMapBreadthFirstIterator(TreeMapNode startNode)
Initialises the iterator with the tree map node at the start of the traversal. |
Method Summary | |
---|---|
boolean |
hasNext()
Reports whether or not there are any more elements in the tree that have yet to be iterated over. |
TreeMapNode |
next()
Provides the next tree map node in the breadth-first traversal of the hierarchy or throws a NoSuchElementException if there are no more nodes to iterate over. |
void |
remove()
Would remove the last returned node from the hierarchy, but does nothing in this case. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeMapBreadthFirstIterator(TreeMapNode startNode)
hasNext
is true).
startNode
- Parent node from which to iterate over the tree.Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator<TreeMapNode>
public TreeMapNode next()
NoSuchElementException
if there are no more nodes to iterate over.
next
in interface java.util.Iterator<TreeMapNode>
public void remove()
remove
in interface java.util.Iterator<TreeMapNode>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |