com.iotabits.examples.revisitor
Class BinaryTreeNode

java.lang.Object
  extended bycom.iotabits.revisitor.BasicVisitable
      extended bycom.iotabits.examples.revisitor.BinaryTreeNode
All Implemented Interfaces:
iVisitable

public class BinaryTreeNode
extends BasicVisitable

This class provides an example of using the visitor without a passback. It represents a binary tree, so the visitation algorithm is simple.


Nested Class Summary
static class BinaryTreeNode.BinaryTreeNodePrinter
           
 
Constructor Summary
BinaryTreeNode(java.lang.Object data)
           
BinaryTreeNode(java.lang.Object data, BinaryTreeNode left, BinaryTreeNode right)
           
 
Method Summary
 void accept(iReflectiveVisitor visitor)
          Dispatches this object to the revisitor.
static void main(java.lang.String[] args)
           
 void setLeft(BinaryTreeNode left)
           
 void setRight(BinaryTreeNode right)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryTreeNode

public BinaryTreeNode(java.lang.Object data,
                      BinaryTreeNode left,
                      BinaryTreeNode right)

BinaryTreeNode

public BinaryTreeNode(java.lang.Object data)
Method Detail

setRight

public void setRight(BinaryTreeNode right)

setLeft

public void setLeft(BinaryTreeNode left)

accept

public void accept(iReflectiveVisitor visitor)
            throws java.lang.Exception
Description copied from class: BasicVisitable
Dispatches this object to the revisitor.

In the reflective idiom we just call revisitor.dispatchToVisit().

Specified by:
accept in interface iVisitable
Overrides:
accept in class BasicVisitable
Parameters:
visitor -
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)