|
Algorithm Development Kit 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectalgs.model.tree.AbstractBinaryTraversal<T>
T - Any class that extends IBinaryTreeNode can be used as the
structure of a Binary tree, and thus can be used as the parameter for this traversal
class.public abstract class AbstractBinaryTraversal<T extends IBinaryTreeNode>
The default traversal class for IBinaryTree trees. Makes it possible to expose a pre-, in-, or post-order traversal as an Iterator.
| Nested Class Summary | |
|---|---|
static class |
AbstractBinaryTraversal.Phase
Binary traversals have three phases. |
| Constructor Summary | |
|---|---|
AbstractBinaryTraversal(T node)
Start the traversal at the given node. |
|
| Method Summary | |
|---|---|
void |
advance()
Advance the traversal, returning the SELF node once found or null when all is done. |
abstract AbstractBinaryTraversal.Phase |
advancePhase(AbstractBinaryTraversal.Phase p)
Determine the next phase in the traversal. |
abstract AbstractBinaryTraversal.Phase |
finalPhase()
Return the final phase of the traversal. |
boolean |
hasNext()
Determines if there are more steps in the traversal. |
abstract AbstractBinaryTraversal.Phase |
initialPhase()
Return the initial phase of the traversal. |
IBinaryTreeNode |
next()
Returns the next node in the traversal. |
void |
remove()
Not supported. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractBinaryTraversal(T node)
node - | Method Detail |
|---|
public abstract AbstractBinaryTraversal.Phase initialPhase()
public abstract AbstractBinaryTraversal.Phase finalPhase()
public abstract AbstractBinaryTraversal.Phase advancePhase(AbstractBinaryTraversal.Phase p)
public void advance()
null when all is done.
public boolean hasNext()
hasNext in interface java.util.Iterator<IBinaryTreeNode>public IBinaryTreeNode next()
next in interface java.util.Iterator<IBinaryTreeNode>public void remove()
remove in interface java.util.Iterator<IBinaryTreeNode>
|
Algorithm Development Kit 1.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||