public class Point extends Object implements Comparable<Point>
Constructor and Description |
---|
Point(int x,
int y)
Initializes this point with the given x- and y-coordinate.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Point other)
Compares this point to the other given point.
|
boolean |
equals(Object object)
Tests whether this point is the same as the given object.
|
int |
hashCode()
Returns the hash code of this point.
|
String |
toString()
Returns a string representation of this point.
|
public Point(int x, int y)
x
- the x-coordinate of this point.y
- the y-coordinate of this point.public int hashCode()
public boolean equals(Object object)
public int compareTo(Point other)
compareTo
in interface Comparable<Point>
other
- another point.