Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

Cell (Lab1)

Class Cell

java.lang.Object
  |
  +--Cell
Direct Known Subclasses:
CircleCell, HexCell, SquareCell

public abstract class Cell
extends Object

Abstract class Cell - Defines signatures of a cell


Constructor Summary
Cell()
          Cell constructor
Cell(double x, double y, double r)
          Cell constructor
 
Method Summary
abstract  double area()
          Calculate the area of the cell
 boolean coverage(double x, double y)
          Check whether a point is covered by the cell
 double distance(double x, double y)
          Calculate the distance of a point to the cell centre
 double getR()
          Get radius of the cell
 double getX()
          Get x coordinate of the cell
 double getY()
          Get y coordinate of the cell
 String toString()
          Represent the Cell content information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cell

public Cell()
Cell constructor


Cell

public Cell(double x,
            double y,
            double r)
Cell constructor

Parameters:
x - Cell X Location
y - Cell Y Location
r - Cell radius
Method Detail

area

public abstract double area()
Calculate the area of the cell

Returns:
Cell Area

coverage

public boolean coverage(double x,
                        double y)
Check whether a point is covered by the cell

Parameters:
x - The x point of access coordinate
y - The y point of access coordinate
Returns:
True/False

distance

public double distance(double x,
                       double y)
Calculate the distance of a point to the cell centre

Parameters:
x - The x point of access coordinate
y - The y point of access coordinate
Returns:
Distance to the cell centre

getR

public double getR()
Get radius of the cell

Returns:
Cell Radius

getX

public double getX()
Get x coordinate of the cell

Returns:
Cell X Location

getY

public double getY()
Get y coordinate of the cell

Returns:
Cell Y Location

toString

public String toString()
Represent the Cell content information

Overrides:
toString in class Object
Returns:
String cell information


Generated by BlueJ