package data.geom.plain;
import java.util.*;
import data.*;
import data.graph.*;
import data.geom.plain.*;
public class Point {
public Point() {
}
public Point(Point o) {
setX(o.getX());
setY(o.getY());
setShape(o.getShape());
}
public Point(Integer x, Integer y, Shape shape) {
setX(x);
setY(y);
setShape(shape);
}
public void setData(Point o) {
setX(o.getX());
setY(o.getY());
setShape(o.getShape());
}
private Integer x;
public Integer getX() {
return x;
}
public void setX(Integer x) {
this.x = x;
}
private Integer y;
public Integer getY() {
return y;
}
public void setY(Integer y) {
this.y = y;
}
protected Shape shape;
public Shape getShape() {
return shape;
}
public void setShape(Shape shape) {
this.shape = shape;
}
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
sb.append("[");
sb.append(x);
sb.append(", ");
sb.append(y);
sb.append("]");
return sb.toString();
}
public String toDisplayString() {
StringBuffer sb = new StringBuffer();
sb.append(x == null ? "" : x.toString());
return sb.toString();
}
public boolean equals(Object other) {
if (this == other) return true;
if (!(other instanceof Point)) return false;
if(!super.equals(other)) return false;
final Point o = (Point) other;
if(o.getX() == null) {
if (getX() != null) return false;
}
else if (!o.getX().equals(getX()))
return false;
if(o.getY() == null) {
if (getY() != null) return false;
}
else if (!o.getY().equals(getY()))
return false;
return true;
}
public int hashCode() {
int res = 0;
if(getX() != null)
res = 29 * res + getX().hashCode();
if(getY() != null)
res = 29 * res + getY().hashCode();
return res;
}
}