Skip to content

Instantly share code, notes, and snippets.

@chaseberry
Last active December 22, 2016 04:03
Show Gist options
  • Save chaseberry/ddbd9d335f6dbaa3055197efffd7ef18 to your computer and use it in GitHub Desktop.
Save chaseberry/ddbd9d335f6dbaa3055197efffd7ef18 to your computer and use it in GitHub Desktop.
JPoint
public class JPoint {
private int x = 0;
private int y = 0;
public JPoint() {
}
public JPoint(int x, int y) {
this.x = x;
this.y = y;
}
@Override
public boolean equals(Object obj) {
return obj instanceof JPoint && ((JPoint) obj).getX() == getX() && ((JPoint) obj).getY() == getY();
}
@Override
public String toString() {
return "JPoint(x=" + x + ", y=" + y + ")";
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment