Class Visitor

java.lang.Object
visitor.Visitor
Direct Known Subclasses:
Counter, Evaluator, Printer

public abstract class Visitor extends Object
Visitor design pattern
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    The Visitor can traverse a Complex number (a subtype of Expression)
    abstract void
    The Visitor can traverse an Integer (a subtype of Expression)
    abstract void
    The Visitor can traverse a Rationnal number (a subtype of Expression)
    abstract void
    The Visitor can traverse a Real number (a subtype of Expression)
    abstract void
    The Visitor can traverse a binary function (a subtype of Expression)
    abstract void
    The Visitor can traverse an unary function (a subtype of Expression)
    abstract void
    The Visitor can traverse an operation (a subtype of Expression)

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Visitor

      public Visitor()
  • Method Details

    • visit

      public abstract void visit(Real r)
      The Visitor can traverse a Real number (a subtype of Expression)
      Parameters:
      r - The Real number being visited
    • visit

      public abstract void visit(Complex c)
      The Visitor can traverse a Complex number (a subtype of Expression)
      Parameters:
      c - The Real number being visited
    • visit

      public abstract void visit(Rationnal q)
      The Visitor can traverse a Rationnal number (a subtype of Expression)
      Parameters:
      q - The Real number being visited
    • visit

      public abstract void visit(Operation o)
      The Visitor can traverse an operation (a subtype of Expression)
      Parameters:
      o - The operation being visited
    • visit

      public abstract void visit(IntegerAtom i)
      The Visitor can traverse an Integer (a subtype of Expression)
      Parameters:
      i - The operation being visited
    • visit

      public abstract void visit(UnaryFunction f)
      The Visitor can traverse an unary function (a subtype of Expression)
      Parameters:
      f - The unary function being visited
    • visit

      public abstract void visit(BinaryFunction f)
      The Visitor can traverse a binary function (a subtype of Expression)
      Parameters:
      f - The binary function being visited