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: SquareRootOperation.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 that represents a square root operation on the given value.
18: *
19: * @author Ole Rahn
20: * <br>
21: * <br>FH Osnabrück - University of Applied Sciences Osnabrück,
22: * <br>Project: PIROL (2005),
23: * <br>Subproject: Daten- und Wissensmanagement
24: *
25: * @version $Rev: 856 $
26: *
27: */
28: public class SquareRootOperation extends FormulaValue {
29:
30: protected FormulaValue value = null;
31:
32: public SquareRootOperation(FormulaValue value) {
33: super ();
34: this .value = value;
35: }
36:
37: /**
38: *@param feature
39: *@return the square root of the given value
40: */
41: public double getValue(Feature feature) {
42: return Math.sqrt(this .value.getValue(feature));
43: }
44:
45: /**
46: *@inheritDoc
47: */
48: public boolean isFeatureDependent() {
49: return this .value.isFeatureDependent();
50: }
51:
52: /**
53: *@inheritDoc
54: */
55: public String toString() {
56: return "Math.sqrt(" + this .value.toString() + ")";
57: }
58:
59: }
|