comparison gnv-artifacts/src/main/java/de/intevation/gnv/math/ConstantFunction.java @ 1119:7c4f81f74c47

merged gnv-artifacts
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:00 +0200
parents f953c9a559d8
children
comparison
equal deleted inserted replaced
1027:fca4b5eb8d2f 1119:7c4f81f74c47
1 /*
2 * Copyright (c) 2010 by Intevation GmbH
3 *
4 * This program is free software under the LGPL (>=v2.1)
5 * Read the file LGPL.txt coming with the software for details
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
7 */
8
9 package de.intevation.gnv.math;
10
11 import org.apache.commons.math.analysis.UnivariateRealFunction;
12
13 /**
14 * Models a constant function to be used in function evaluation.
15 *
16 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
17 */
18 public class ConstantFunction
19 implements UnivariateRealFunction
20 {
21 /**
22 * The constant value.
23 */
24 protected double value;
25
26 /**
27 * Defaut constructor.
28 */
29 public ConstantFunction() {
30 }
31
32 /**
33 * Constructor to create a ConstantFunction with
34 * a given constant value.
35 * @param value The constant value.
36 */
37 public ConstantFunction(double value) {
38 this.value = value;
39 }
40
41 public double value(double x) {
42 return value;
43 }
44 }
45 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org