view backend/src/main/java/org/dive4elements/river/importer/XY.java @ 6328:53d08f33d094

Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 13 Jun 2013 17:15:34 +0200
parents 4c3ccf2b0304
children e1b831fe435a
line wrap: on
line source
/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU AGPL (>=v3)
 * and comes with ABSOLUTELY NO WARRANTY! Check out the
 * documentation coming with Dive4Elements River for details.
 */

package org.dive4elements.river.importer;


/** Two doubles and an int index. */
public class XY
implements   Comparable<XY>
{
    public static final double X_EPSILON = 1e-4;

    protected double x;
    protected double y;
    protected int    index;

    public XY() {
    }

    public XY(double x, double y, int index) {
        this.x     = x;
        this.y     = y;
        this.index = index;
    }

    @Override
    public int compareTo(XY other) {
        if (x + X_EPSILON < other.x) return -1;
        if (x > other.x + X_EPSILON) return +1;
        if (index < other.index)     return -1;
        if (index > other.index)     return +1;
        return 0;
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org