Visitor.java

package visitor;

import calculator.operations.Operation;
import calculator.atoms.*;
import calculator.functions.*;

/**
 * Visitor design pattern
 */
public abstract class Visitor {

	/**
	 * The Visitor can traverse a Real number (a subtype of Expression)
	 *
	 * @param r The Real number being visited
	 */
	public abstract void visit(Real r);

	/**
	 * The Visitor can traverse a Complex number (a subtype of Expression)
	 *
	 * @param c The Real number being visited
	 */
	public abstract void visit(Complex c);

	/**
	 * The Visitor can traverse a Rationnal number (a subtype of Expression)
	 *
	 * @param q The Real number being visited
	 */
	public abstract void visit(Rationnal q);

	/**
	 * The Visitor can traverse an operation (a subtype of Expression)
	 *
	 * @param o The operation being visited
	 */
	public abstract void visit(Operation o);

	/**
	 * The Visitor can traverse an Integer (a subtype of Expression)
	 *
	 * @param i The operation being visited
	 */
	public abstract void visit(IntegerAtom i);

	/**
	 * The Visitor can traverse an unary function (a subtype of Expression)
	 *
	 * @param f The unary function being visited
	 */
	public abstract void visit(UnaryFunction f);

	/**
	 * The Visitor can traverse a binary function (a subtype of Expression)
	 *
	 * @param f The binary function being visited
	 */
	public abstract void visit(BinaryFunction f);
}