diff flys-backend/src/main/java/org/dive4elements/river/importer/XY.java @ 5828:dfb26b03b179

Moved directories to org.dive4elements.river
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 11:53:11 +0200
parents flys-backend/src/main/java/de/intevation/flys/importer/XY.java@2b0426b79a92
children 18619c1e7c2a
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-backend/src/main/java/org/dive4elements/river/importer/XY.java	Thu Apr 25 11:53:11 2013 +0200
@@ -0,0 +1,56 @@
+package de.intevation.flys.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