Class PointXY

java.lang.Object
  extended by PointXY
All Implemented Interfaces:
java.lang.Comparable<PointXY>

public class PointXY
extends java.lang.Object
implements java.lang.Comparable<PointXY>


Constructor Summary
PointXY(int xc, int yc)
          Constructs a PointXY at the specified location
 
Method Summary
 int compareTo(PointXY other)
           
 double distance2D(PointXY param)
          Returns the distance between two points
 boolean equals(java.lang.Object o)
           
 int getX()
          returns the x coordinate of this point
 int getY()
          returns the y coordinate of this point
static void main(java.lang.String[] args)
           
 void setX(int xValue)
          sets the x coordinate to the supplied value
 void setXY(int xValue, int yValue)
          sets the x and y coordinates to the supplied values
 void setY(int yValue)
          sets the y coordinate to the supplied value
 java.lang.String toString()
          Returns a string representing this point
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PointXY

public PointXY(int xc,
               int yc)
Constructs a PointXY at the specified location

Method Detail

getX

public int getX()
returns the x coordinate of this point

Returns:
the x coordinate

getY

public int getY()
returns the y coordinate of this point

Returns:
the y coordinate

setX

public void setX(int xValue)
sets the x coordinate to the supplied value

Parameters:
xValue - the new x coordinate

setY

public void setY(int yValue)
sets the y coordinate to the supplied value

Parameters:
yValue - the new y coordinate

setXY

public void setXY(int xValue,
                  int yValue)
sets the x and y coordinates to the supplied values

Parameters:
xValue - the new x coordinate
yValue - the new y coordinate

distance2D

public double distance2D(PointXY param)
Returns the distance between two points

Returns:
the distance between this point and one supplied

compareTo

public int compareTo(PointXY other)
Specified by:
compareTo in interface java.lang.Comparable<PointXY>

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representing this point

Overrides:
toString in class java.lang.Object
Returns:
the string representation

main

public static void main(java.lang.String[] args)