summaryrefslogtreecommitdiffstats
path: root/Master/Software Architektur/SWA_Prakt2/src/net/sven_eisenhauer/swa_prakt2/ArithmeticOperation.java
diff options
context:
space:
mode:
Diffstat (limited to 'Master/Software Architektur/SWA_Prakt2/src/net/sven_eisenhauer/swa_prakt2/ArithmeticOperation.java')
-rw-r--r--Master/Software Architektur/SWA_Prakt2/src/net/sven_eisenhauer/swa_prakt2/ArithmeticOperation.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/Master/Software Architektur/SWA_Prakt2/src/net/sven_eisenhauer/swa_prakt2/ArithmeticOperation.java b/Master/Software Architektur/SWA_Prakt2/src/net/sven_eisenhauer/swa_prakt2/ArithmeticOperation.java
new file mode 100644
index 0000000..5bcad84
--- /dev/null
+++ b/Master/Software Architektur/SWA_Prakt2/src/net/sven_eisenhauer/swa_prakt2/ArithmeticOperation.java
@@ -0,0 +1,30 @@
+package net.sven_eisenhauer.swa_prakt1;
+
+public abstract class ArithmeticOperation implements ArithmeticExpression{
+ protected ArithmeticExpression operand1;
+ protected ArithmeticExpression operand2;
+ protected String operationSign;
+ public ArithmeticOperation(ArithmeticExpression operand1
+ ,ArithmeticExpression operand2){
+ this.operand1 = operand1;
+ this.operand2 = operand2;
+ }/*
+ @Override
+ public void print() {
+ System.out.print("(");
+ operand1.print();
+ System.out.print(operationSign);
+ operand2.print();
+ System.out.print(")");
+ }*/
+ public String getOperationSign() {
+ return operationSign;
+ }
+ public ArithmeticExpression getLeftOperand() {
+ return operand1;
+ }
+ public ArithmeticExpression getRightOperand() {
+ return operand2;
+ }
+ public abstract Number doOperation(Number opLeft, Number opRight);
+}