lab7
Class ReflectiveVisitor

java.lang.Object
  extended by lab7.ReflectiveVisitor
Direct Known Subclasses:
NodeVisitor

public abstract class ReflectiveVisitor
extends java.lang.Object

A reflective version of Visitor Adapted from http://www.javaworld.com/javaworld/javatips/jw-javatip98.html


Field Summary
static boolean debug
           
 
Constructor Summary
ReflectiveVisitor()
           
 
Method Summary
abstract  void defaultVisit(java.lang.Object o)
           
 void dispatch(java.lang.Object o)
          Method to accomplish the double-dispatch.
 void perform(AbstractNode n)
          Method to kick things off.
 ReflectiveVisitor performVisit(AbstractNode n)
          Better version of perform
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Constructor Detail

ReflectiveVisitor

public ReflectiveVisitor()
Method Detail

defaultVisit

public abstract void defaultVisit(java.lang.Object o)

perform

public void perform(AbstractNode n)
Method to kick things off. Override to do other stuff if you wish


performVisit

public final ReflectiveVisitor performVisit(AbstractNode n)
Better version of perform


dispatch

public final void dispatch(java.lang.Object o)
Method to accomplish the double-dispatch.