2017-05-29 12:15:51 +00:00
|
|
|
package Model;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
|
|
|
|
*
|
|
|
|
* @Author: Armin Wolf
|
|
|
|
* @Email: a_wolf28@uni-muenster.de
|
|
|
|
* @Date: 28.05.2017.
|
|
|
|
*/
|
2017-06-12 19:30:27 +00:00
|
|
|
public class Point implements Comparable<Point> {
|
2017-05-29 12:15:51 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
private Double x;
|
|
|
|
private Double y;
|
|
|
|
private String id;
|
2017-05-29 12:15:51 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
public Point(Double x, Double y) {
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
}
|
2017-05-29 12:15:51 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
public Point(Double x, Double y, String id) {
|
|
|
|
this.x = x;
|
|
|
|
this.y = y;
|
|
|
|
this.id = id;
|
|
|
|
}
|
2017-06-18 16:24:30 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
public Double getX() {
|
|
|
|
return x;
|
|
|
|
}
|
2017-05-29 12:15:51 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
public void setX(Double x) {
|
|
|
|
this.x = x;
|
|
|
|
}
|
2017-05-29 12:15:51 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
public Double getY() {
|
|
|
|
return y;
|
|
|
|
}
|
2017-05-29 12:15:51 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
public void setY(Double y) {
|
|
|
|
this.y = y;
|
|
|
|
}
|
2017-05-29 12:15:51 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
@Override
|
|
|
|
public int compareTo(Point o) {
|
|
|
|
if (this.getX() == o.getX()) {
|
|
|
|
if (this.getY() <= o.getY()) {
|
|
|
|
return -1;
|
|
|
|
} else {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
} else if (this.getX() < o.getX()) {
|
|
|
|
return -1;
|
|
|
|
} else {
|
|
|
|
return 1;
|
2017-05-29 12:15:51 +00:00
|
|
|
}
|
2017-06-20 14:59:24 +00:00
|
|
|
}
|
2017-06-18 16:24:30 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
public String getId() {
|
|
|
|
return id;
|
|
|
|
}
|
2017-06-18 16:24:30 +00:00
|
|
|
|
2017-06-20 14:59:24 +00:00
|
|
|
public void setId(String id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
2017-05-29 12:15:51 +00:00
|
|
|
}
|