net.sf.jga.fn
Interface Visitable

All Known Implementing Classes:
Accumulate, All, AndBinary, AndGenerator, AndUnary, Any, ApplyBinary, ApplyGenerator, ApplyUnary, ArrayBinary, ArrayUnary, Average, Between, Between.Comparable, BinaryFunctor, BinaryNegate, Bind, Bind1st, Bind2nd, BindNth, BitwiseAnd, BitwiseNot, BitwiseOr, BitwiseXor, Cast, ChainBinary, ChainFunctor, ChainUnary, ComparatorFn, CompareProperty, ComposeBinary, ComposeBinaryNth, ComposeUnary, ComposeUnaryNth, Compound, CompoundBinary, CompoundGenerator, CompoundUnary, ConditionalBinary, ConditionalGenerator, ConditionalUnary, Constant, ConstantBinary, ConstantUnary, Construct, ConstructDefault, ConstructUnary, Count, DefaultFormat, Distribute, Divides, ElementOf, EqualEqual, Equality, EqualTo, ForEach, FormatValue, Functor, Generate, Generate1st, Generate2nd, GenerateBinary, GenerateNth, GenerateUnary, Generator, GetField, GetProperty, Greater, Greater.Comparable, GreaterEqual, GreaterEqual.Comparable, Identity, Identity.Accessor, InstanceOf, Invoke, InvokeMethod, InvokeNoArgMethod, Less, Less.Comparable, LessEqual, LessEqual.Comparable, LogicalAnd, LogicalNot, LogicalOr, Match, Max, Max.Comparable, MaxValue, Min, Min.Comparable, Minus, MinValue, Modulus, Multiplex, Multiplies, Negate, NotEqualEqual, NotEqualTo, OrBinary, OrGenerator, OrUnary, ParseFormat, ParseFormat.Date, ParseFormat.Number, Plus, Project1st, Project2nd, Random, SetAndReturnField, SetField, SetProperty, ShiftLeft, ShiftRight, UnaryFunctor, UnaryNegate, UnsignedShiftRight, ValueOf

public interface Visitable

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(Visitor v) {
          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

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.
 

Method Detail

accept

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.



Copyright © 2002-2006 David A. Hall. All Rights Reserved.