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

SquareCell (Lab1)

Class SquareCell

java.lang.Object
  |
  +--Cell
        |
        +--SquareCell

public class SquareCell
extends Cell

A SquareCell

Version:
1.0 (2002)
Author:
CPwJ

Constructor Summary
SquareCell(double x, double y, double r)
          SquareCell constructor
 
Method Summary
 double area()
          Calculate the area of a Square shape Cell
 boolean coverage(double x, double y)
          Check whether a point is covered by the Square cell
 
Methods inherited from class Cell
distance, getR, getX, getY, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SquareCell

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

Parameters:
x - Cell X coordinate
y - Cell Y coordinate
r - Cell Radius
Method Detail

area

public double area()
Calculate the area of a Square shape Cell

Specified by:
area in class Cell
Returns:
the area of the Square Cell

coverage

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

Overrides:
coverage in class Cell
Parameters:
x - The x point of access coordinate
y - The y point of access coordinate
Returns:
True/False


Generated by BlueJ