Class Circle

java.lang.Object
  extended by Circle

public class Circle
extends java.lang.Object

A class to represent a circle.


Constructor Summary
Circle(double x, double y, double radius)
          Create a circle object with center at point x,y and a given radius.
 
Method Summary
 double getRadius()
          Get the radius.
 double getX()
          Get the x-coordinate of the center.
 double getY()
          Get the y-coordinate of the center.
 void move(double newX, double newY)
          Move a circle object to a specified point.
 void setRadius(double newRadius)
          Reset the radius to a specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Circle

public Circle(double x,
              double y,
              double radius)
Create a circle object with center at point x,y and a given radius.

Parameters:
x - the x-coordinate of the center
y - the y-coordinate of the center
radius - the radius
Method Detail

getX

public double getX()
Get the x-coordinate of the center.

Returns:
the x-coordinate of the center

getY

public double getY()
Get the y-coordinate of the center.

Returns:
the y-coordinate of the center

getRadius

public double getRadius()
Get the radius.

Returns:
the radius

setRadius

public void setRadius(double newRadius)
Reset the radius to a specified value.

Parameters:
newRadius - the new radius of the circle

move

public void move(double newX,
                 double newY)
Move a circle object to a specified point.

Parameters:
newX - the new x-coordinate of the center
newY - the new y-coordinate of the center