net.moioli.drawables
Class DoublePoint

java.lang.Object
  extended by net.moioli.drawables.DoublePoint
Direct Known Subclasses:
BigPoint

public class DoublePoint
extends java.lang.Object

Represents a point in the cartesian plane.

Version:
2005/10/5
Author:
Silvio Moioli

Field Summary
 double x
          The x coordinate of the Point.
 double y
          The y coordinate of the Point.
 
Constructor Summary
DoublePoint()
          Constructs the point (0,0).
DoublePoint(double x, double y)
          Standard constructor.
DoublePoint(DoublePoint p)
          Copy constructor.
 
Method Summary
 double getX()
          Returns x.
 double getY()
          Returns y.
 void setX(double x)
          Sets the x value.
 void setY(double y)
          Sets the y value.
 java.lang.String toString()
          Returns a representaive string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x
The x coordinate of the Point.


y

public double y
The y coordinate of the Point.

Constructor Detail

DoublePoint

public DoublePoint()
Constructs the point (0,0).


DoublePoint

public DoublePoint(DoublePoint p)
Copy constructor.

Parameters:
p - the point to be copied

DoublePoint

public DoublePoint(double x,
                   double y)
Standard constructor.

Parameters:
x - the point's x coordinate
y - the point's y coordinate
Method Detail

getX

public double getX()
Returns x.

Returns:
x value

getY

public double getY()
Returns y.

Returns:
y value

toString

public java.lang.String toString()
Returns a representaive string.

Overrides:
toString in class java.lang.Object
Returns:
a string in the (x,y) format

setX

public void setX(double x)
Sets the x value.

Parameters:
x - the new x coordinate

setY

public void setY(double y)
Sets the y value.

Parameters:
y - the new y coordinate