1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package net.sf.magicproject.operation;
24
25 import java.io.IOException;
26 import java.io.InputStream;
27
28 import net.sf.magicproject.expression.Expression;
29 import net.sf.magicproject.expression.ExpressionFactory;
30 import net.sf.magicproject.expression.UnaryExpression;
31
32
33 /***
34 * Represents an unary operation.
35 *
36 * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
37 * @since 0.80
38 */
39 public abstract class UnaryOperation extends Operation {
40
41 /***
42 * Creates a new instance of UnaryOperation <br>
43 */
44 public UnaryOperation() {
45 super();
46 }
47
48 @Override
49 public Expression readNextExpression(InputStream inputFile)
50 throws IOException {
51 return new UnaryExpression(this, ExpressionFactory
52 .readNextExpression(inputFile));
53 }
54
55 @Override
56 public abstract int process(int leftValue, int rightValue);
57
58 @Override
59 public abstract String getOperator();
60 }