Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/math/XYColumn.java @ 807:a645bd23c1c8
Added more javadoc. Removed trailing whitespace.
gnv-artifacts/trunk@889 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 08 Apr 2010 15:24:45 +0000 |
parents | 6cff63d0c434 |
children | 05bf8534a35a |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/XYColumn.java Thu Apr 08 13:10:39 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/XYColumn.java Thu Apr 08 15:24:45 2010 +0000 @@ -15,6 +15,9 @@ import org.apache.log4j.Logger; /** + * A column of discrete attributed height values located at a point. + * Values between the discrete height values are interpolated. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> */ @@ -24,23 +27,49 @@ { private static Logger log = Logger.getLogger(XYColumn.class); + /** + * The list of discrete height values. + */ protected List<HeightValue> values; + /** + * The curve used to interpolate the points between the + * discrete height values. + */ protected transient UnivariateRealFunction curve; + /** + * Default constructor. + */ public XYColumn() { values = new ArrayList<HeightValue>(); } + /** + * Constructor to create an XYColumn with a given (x, y) coordinate + * and an (i, j) index tuple. + * @param x The x coordinate. + * @param y The y coordinate. + * @param i The i component. + * @param j The j component. + */ public XYColumn(double x, double y, int i, int j) { super(x, y, i, j); values = new ArrayList<HeightValue>(); } + /** + * Adds a given height value to the list of height values. + * @param value The height value. + */ public void add(HeightValue value) { values.add(value); } + /** + * Returns the list of height values. + * @return The list of height values. + */ public List<HeightValue> getValues() { return values; } @@ -63,6 +92,12 @@ return Double.NaN; } + /** + * Prepares this XYColumn to be queried. A given XYDepth + * object is used to fill the values to a certain depth. + * @param xyDepth To figure out the depth a the cordinate. + * @return true if preparation succeeds else false. + */ public boolean prepare(XYDepth xyDepth) { if (curve == null) { int N = values.size(); @@ -120,8 +155,15 @@ return true; } + /** + * Returns the interpolator used to interpolate the values between + * the discrete height values. This class returns an instance of + * {@link org.apache.commons.math.analysis.interpolation.SplineInterpolator}. + * Override this if you want to use another kind of interpolation. + * @return The interpolator to be used. + */ protected UnivariateRealInterpolator getInterpolator() { return new SplineInterpolator(); } } -// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file