1 package visitor;
2
3 import calculator.operations.Operation;
4 import calculator.atoms.*;
5 import calculator.functions.*;
6
7 /**
8 * Visitor design pattern
9 */
10 public abstract class Visitor {
11
12 /**
13 * The Visitor can traverse a Real number (a subtype of Expression)
14 *
15 * @param r The Real number being visited
16 */
17 public abstract void visit(Real r);
18
19 /**
20 * The Visitor can traverse a Complex number (a subtype of Expression)
21 *
22 * @param c The Real number being visited
23 */
24 public abstract void visit(Complex c);
25
26 /**
27 * The Visitor can traverse a Rationnal number (a subtype of Expression)
28 *
29 * @param q The Real number being visited
30 */
31 public abstract void visit(Rationnal q);
32
33 /**
34 * The Visitor can traverse an operation (a subtype of Expression)
35 *
36 * @param o The operation being visited
37 */
38 public abstract void visit(Operation o);
39
40 /**
41 * The Visitor can traverse an Integer (a subtype of Expression)
42 *
43 * @param i The operation being visited
44 */
45 public abstract void visit(IntegerAtom i);
46
47 /**
48 * The Visitor can traverse an unary function (a subtype of Expression)
49 *
50 * @param f The unary function being visited
51 */
52 public abstract void visit(UnaryFunction f);
53
54 /**
55 * The Visitor can traverse a binary function (a subtype of Expression)
56 *
57 * @param f The binary function being visited
58 */
59 public abstract void visit(BinaryFunction f);
60 }