Defines an interface for classes that may be interpreted by a Visitor.
jga uses the AcyclicVisitor
pattern to provide a structure for implementing Visitor. Within jga, each
class that implements Visitable provides a nested interface called Visitor
that defines a visit method for the class. This is typically
implemented with the following boilerplate:
public class Foo implements Visitable
public void accept(net.sf.jga.fn.Visitor v) {
if (v instanceof Foo.Visitor)
((Foo.Visitor)v).visit(this);
else
v.visit(this);
}
public interface Visitor extends net.sf.jga.fn.Visitor {
public void visit(Foo host);
}
Copyright © 2002-2005 David A. Hall
author: David A. Hall |