view
Class Region

java.lang.Object
  extended by view.Region

public class Region
extends Object

A simple class describing a region in some 2-dimensional space. It takes the center of the region and the extension along the principal axis.


Field Summary
private  double h
          The y-size of the region.
private  double w
          The x-size of the region.
private  double x
          The x-center of the region.
private  double y
          The y-center of the region.
 
Constructor Summary
Region()
          Constructs a new, empty region.
Region(double ra, double dec, double width, double height)
          Constructs a new region specifiying the center and the size.
 
Method Summary
 boolean equals(Object that)
          Two regions are equal if they are both valid, have the same center and the same size.
 Point2D getCenter()
          Returns the center of the region if valid.
 double getHeight()
          Returns the height of the region.
 double getWidth()
          Returns the width of the region.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

private double x
The x-center of the region.


y

private double y
The y-center of the region.


w

private double w
The x-size of the region.


h

private double h
The y-size of the region.

Constructor Detail

Region

public Region()
Constructs a new, empty region. Invalidates center and size.


Region

public Region(double ra,
              double dec,
              double width,
              double height)
Constructs a new region specifiying the center and the size.

Method Detail

getCenter

public Point2D getCenter()
Returns the center of the region if valid.


getWidth

public double getWidth()
Returns the width of the region.


getHeight

public double getHeight()
Returns the height of the region.


equals

public boolean equals(Object that)
Two regions are equal if they are both valid, have the same center and the same size.

Overrides:
equals in class Object