sascha@1204: package de.intevation.flys.importer;
sascha@1204: 
felix@4707: 
felix@4707: /** Two doubles and an int index. */
sascha@1204: public class XY
sascha@1204: implements   Comparable<XY>
sascha@1204: {
sascha@1204:     public static final double X_EPSILON = 1e-4;
sascha@1204: 
sascha@1204:     protected double x;
sascha@1204:     protected double y;
sascha@1204:     protected int    index;
sascha@1204: 
sascha@1204:     public XY() {
sascha@1204:     }
sascha@1204: 
sascha@1204:     public XY(double x, double y, int index) {
sascha@1204:         this.x     = x;
sascha@1204:         this.y     = y;
sascha@1204:         this.index = index;
sascha@1204:     }
sascha@1204: 
sascha@1204:     @Override
sascha@1204:     public int compareTo(XY other) {
sascha@1204:         if (x + X_EPSILON < other.x) return -1;
sascha@1204:         if (x > other.x + X_EPSILON) return +1;
sascha@1204:         if (index < other.index)     return -1;
sascha@1204:         if (index > other.index)     return +1;
sascha@1204:         return 0;
sascha@1204:     }
sascha@1204: 
sascha@1204:     public double getX() {
sascha@1204:         return x;
sascha@1204:     }
sascha@1204: 
sascha@1204:     public void setX(double x) {
sascha@1204:         this.x = x;
sascha@1204:     }
sascha@1204: 
sascha@1204:     public double getY() {
sascha@1204:         return y;
sascha@1204:     }
sascha@1204: 
sascha@1204:     public void setY(double y) {
sascha@1204:         this.y = y;
sascha@1204:     }
sascha@1204: 
sascha@1204:     public int getIndex() {
sascha@1204:         return index;
sascha@1204:     }
sascha@1204: 
sascha@1204:     public void setIndex(int index) {
sascha@1204:         this.index = index;
sascha@1204:     }
sascha@1204: }
sascha@1204: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :