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

Constructor Index

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

Method Index

 o display()
Display the point on the standard output stream.
 o less(Element)
Is this element less than some other element?
 o same(Element)
Is this element equal to some other element?
 o x()
Access the x coordinate of a point.
 o y()
Access the y coordinate of a point.

Constructors

 o 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

Methods

 o x
 public int x()
Access the x coordinate of a point.

Returns:
the coordinate
 o y
 public int y()
Access the y coordinate of a point.

Returns:
the coordinate
 o same
 public boolean same(Element e)
Is this element equal to some other element?

See Also:
same
 o less
 public boolean less(Element e)
Is this element less than some other element?

See Also:
less
 o 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