01: /*
02: * Created on 29.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: PowerOfOperation.java 856 2007-06-19 04:15:27Z javamap $
09: */
10: package de.fho.jump.pirol.utilities.FormulaParsing.Operations;
11:
12: import com.vividsolutions.jump.feature.Feature;
13:
14: import de.fho.jump.pirol.utilities.FormulaParsing.FormulaValue;
15:
16: /**
17: * Class to handle Math.pow() like operations. The result is a value that equals
18: * <code>Math.pow(value1, value2)</code>.
19: *
20: * @author Ole Rahn
21: * <br>
22: * <br>FH Osnabrück - University of Applied Sciences Osnabrück,
23: * <br>Project: PIROL (2005),
24: * <br>Subproject: Daten- und Wissensmanagement
25: *
26: * @version $Rev: 856 $
27: *
28: */
29: public class PowerOfOperation extends GenericOperation {
30:
31: /**
32: *@param value1
33: *@param value2
34: */
35: public PowerOfOperation(FormulaValue value1, FormulaValue value2) {
36: super (value1, value2);
37: }
38:
39: /**
40: *@param feature
41: *@return Math.pow(value1, value2)
42: */
43: public double getValue(Feature feature) {
44: return Math.pow(this .value1.getValue(feature), this .value2
45: .getValue(feature));
46: }
47:
48: /**
49: *@inheritDoc
50: */
51: public String toString() {
52: return "Math.pow(" + this .value1.toString() + ", "
53: + this .value2.toString() + ")";
54: }
55: }
|