net.sf.jga.fn
public interface Visitable
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); } public interface Visitor extends net.sf.jga.fn.Visitor { public void visit(Foo host); }
Copyright © 2002 David A. Hall
Method Summary | |
---|---|
void | accept(Visitor visitor)
Determine if the visitor is appropriate (typically by testing against
a specific interface) and if so, call pass the implementing object to
the visitor's visit method. |