01: /*
02: * Created on 23.06.2005 for PIROL
03: *
04: * SVN header information:
05: * $Author: javamap $
06: * $Rev: 856 $
07: * $Date: 2007-06-18 21:15:27 -0700 (Mon, 18 Jun 2007) $
08: * $Id: GenericOperation.java 856 2007-06-19 04:15:27Z javamap $
09: */
10: package de.fho.jump.pirol.utilities.FormulaParsing.Operations;
11:
12: import de.fho.jump.pirol.utilities.FormulaParsing.FormulaValue;
13:
14: /**
15: * Base class for mathmatic operations like division, addition, etc.
16: *
17: * @author Ole Rahn
18: * <br>
19: * <br>FH Osnabrück - University of Applied Sciences Osnabrück,
20: * <br>Project: PIROL (2005),
21: * <br>Subproject: Daten- und Wissensmanagement
22: *
23: * @version $Rev: 856 $
24: *
25: */
26: public abstract class GenericOperation extends FormulaValue {
27:
28: protected FormulaValue value1 = null, value2 = null;
29: protected String opString = "#";
30:
31: /**
32: * Sets the value, that will be operated on.
33: *@param value1
34: *@param value2
35: */
36: public GenericOperation(FormulaValue value1, FormulaValue value2) {
37: super ();
38: this .value1 = value1;
39: this .value2 = value2;
40: }
41:
42: /**
43: * @inheritDoc
44: */
45: public boolean isFeatureDependent() {
46: return this .value1.isFeatureDependent()
47: || this .value2.isFeatureDependent();
48: }
49:
50: /**
51: * @inheritDoc
52: */
53: public String toString() {
54: return "(" + this .value1.toString() + ") " + this .opString
55: + " (" + this .value2 + ")";
56: }
57:
58: }
|