All Packages Class Hierarchy This Package Previous Next Index
Class sp.Point
java.lang.Object

+sp.Point
 public final class Point
 extends Object
 implements Element
The class Point implements immutable two dimensional points.
These points can be used as elements of sets.
 See Also:
 Set

Point(int, int)
 Construct a point from an x coordinate and a y coordinate.

display()
 Display the point on the standard output stream.

less(Element)
 Is this element less than some other element?

same(Element)
 Is this element equal to some other element?

x()
 Access the x coordinate of a point.

y()
 Access the y coordinate of a point.
Point
public Point(int x,
int y)
 Construct a point from an x coordinate and a y coordinate.
 Parameters:
 x  the x coordinate
 y  the y coordinate
 Returns:
 the new point
x
public int x()
 Access the x coordinate of a point.
 Returns:
 the coordinate
y
public int y()
 Access the y coordinate of a point.
 Returns:
 the coordinate
same
public boolean same(Element e)
 Is this element equal to some other element?
 See Also:
 same
less
public boolean less(Element e)
 Is this element less than some other element?
 See Also:
 less
display
public void display()
 Display the point on the standard output stream.
Used only for debugging.
All Packages Class Hierarchy This Package Previous Next Index