fc.util
Class Tree.IterationOrder

java.lang.Object
  extended by fc.util.Tree.IterationOrder
Enclosing class:
Tree

public abstract static class Tree.IterationOrder
extends Object


Field Summary
static Tree.IterationOrder BreadthFirst
          A breadth first iteration of the tree, starting from the specified startnode.
static Tree.IterationOrder InOrder
          A depth first, left to right, in order iteration starting from the specified startnode.
static Tree.IterationOrder PostOrder
          A depth first, left to right, post order iteration starting from the specified startnode
static Tree.IterationOrder PreOrder
          A depth first, left to right, pre order iteration starting from the specified startnode.
 
Method Summary
abstract  Iterator iterator(Tree.Node startnode)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BreadthFirst

public static final Tree.IterationOrder BreadthFirst
A breadth first iteration of the tree, starting from the specified startnode.


PreOrder

public static final Tree.IterationOrder PreOrder
A depth first, left to right, pre order iteration starting from the specified startnode.


InOrder

public static final Tree.IterationOrder InOrder
A depth first, left to right, in order iteration starting from the specified startnode. In order iteration only makes sense when each node has a maximum of 2 child nodes (since the parent node is visited between the left and right children). Therefore this iteration will throw a runtime exception if more than 2 children are encountered for any node.


PostOrder

public static final Tree.IterationOrder PostOrder
A depth first, left to right, post order iteration starting from the specified startnode

Method Detail

iterator

public abstract Iterator iterator(Tree.Node startnode)