comparison flys-backend/src/main/java/de/intevation/flys/importer/XY.java @ 3471:e4250c6e1538 2.8.1

merged flys-backend/2.8.1
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:40 +0200
parents 22858e7cca79
children 2b0426b79a92
comparison
equal deleted inserted replaced
3468:f37e7e8907cb 3471:e4250c6e1538
1 package de.intevation.flys.importer;
2
3 public class XY
4 implements Comparable<XY>
5 {
6 public static final double X_EPSILON = 1e-4;
7
8 protected double x;
9 protected double y;
10 protected int index;
11
12 public XY() {
13 }
14
15 public XY(double x, double y, int index) {
16 this.x = x;
17 this.y = y;
18 this.index = index;
19 }
20
21 @Override
22 public int compareTo(XY other) {
23 if (x + X_EPSILON < other.x) return -1;
24 if (x > other.x + X_EPSILON) return +1;
25 if (index < other.index) return -1;
26 if (index > other.index) return +1;
27 return 0;
28 }
29
30 public double getX() {
31 return x;
32 }
33
34 public void setX(double x) {
35 this.x = x;
36 }
37
38 public double getY() {
39 return y;
40 }
41
42 public void setY(double y) {
43 this.y = y;
44 }
45
46 public int getIndex() {
47 return index;
48 }
49
50 public void setIndex(int index) {
51 this.index = index;
52 }
53 }
54 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org