66 lines
1.2 KiB
Java
66 lines
1.2 KiB
Java
package Model;
|
|
|
|
/**
|
|
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
|
|
*
|
|
* @Author: Armin Wolf
|
|
* @Email: a_wolf28@uni-muenster.de
|
|
* @Date: 28.05.2017.
|
|
*/
|
|
public class Point implements Comparable<Point> {
|
|
|
|
private Double x;
|
|
private Double y;
|
|
private String id;
|
|
|
|
public Point(Double x, Double y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
|
|
public Point(Double x, Double y, String id) {
|
|
this.x = x;
|
|
this.y = y;
|
|
this.id = id;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
@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;
|
|
}
|
|
}
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
}
|