comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/ConstantFunction.java @ 875:5e9efdda6894

merged gnv-artifacts/1.0
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:13:56 +0200
parents a645bd23c1c8
children f953c9a559d8
comparison
equal deleted inserted replaced
722:bb3ffe7d719e 875:5e9efdda6894
1 package de.intevation.gnv.math;
2
3 import org.apache.commons.math.analysis.UnivariateRealFunction;
4
5 /**
6 * Models a constant function to be used in function evaluation.
7 *
8 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
9 */
10 public class ConstantFunction
11 implements UnivariateRealFunction
12 {
13 /**
14 * The constant value.
15 */
16 protected double value;
17
18 /**
19 * Defaut constructor.
20 */
21 public ConstantFunction() {
22 }
23
24 /**
25 * Constructor to create a ConstantFunction with
26 * a given constant value.
27 * @param value The constant value.
28 */
29 public ConstantFunction(double value) {
30 this.value = value;
31 }
32
33 public double value(double x) {
34 return value;
35 }
36 }
37 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org