astro
Class SimpleSite

java.lang.Object
  extended by astro.SimpleSite
All Implemented Interfaces:
Site, PI
Direct Known Subclasses:
AptSite, TenerifeSite

public class SimpleSite
extends Object
implements Site, PI

A helper class that implements the Site interface. It provides implementation for all methods in the site interface.


Field Summary
private  double Elevation
          The elevation of this site.
private  double Latitude
          The latitude of this site.
private  double Longitude
          The longitude of this site.
 
Fields inherited from interface astro.Site
ALTITUDES, LATITUDES, LONGITUDES, OBSERVATORIES
 
Fields inherited from interface vec_math.PI
HOUR, PIHALF, PITWO, RADIAN
 
Constructor Summary
protected SimpleSite()
          Do not use this constructor directly.
  SimpleSite(double lambda, double phi, double height)
          Constructs a fully qualified site out of the longitude, latitude, and elevation of this site.
 
Method Summary
 boolean equals(Object that)
          Two sites are equal, if their geographical position and their height are identically.
 double getElevation()
          Gets the elevation of this site, in meters.
 double getLatitude()
          Gets the latitude of this site, in radians.
 double getLongitude()
          Returns the longitude of this site, in radians.
 void setElevation(double height)
          Sets the elevation of this site, in meters.
 void setLatitude(double phi)
          Sets the latitude of this site, in radians.
 void setLongitude(double lambda)
          Sets the longitude of this site, in radians.
 String toString()
          Returns a simple representation of this site.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Longitude

private double Longitude
The longitude of this site.


Latitude

private double Latitude
The latitude of this site.


Elevation

private double Elevation
The elevation of this site.

Constructor Detail

SimpleSite

protected SimpleSite()
Do not use this constructor directly. Provide subclasses that implement it.


SimpleSite

public SimpleSite(double lambda,
                  double phi,
                  double height)
Constructs a fully qualified site out of the longitude, latitude, and elevation of this site. Eastern longitudes and southern latitudes are negative.

Parameters:
lambda - The longitude of this site, in radians.
phi - The latitude of this site, in radians.
height - The elevation, in meters.
Method Detail

getLongitude

public double getLongitude()
Returns the longitude of this site, in radians. Eastern longitudes are negative.

Specified by:
getLongitude in interface Site
Returns:
The longitude in radians.

setLongitude

public void setLongitude(double lambda)
Sets the longitude of this site, in radians. Eastern longitudes are negative.

Specified by:
setLongitude in interface Site

getLatitude

public double getLatitude()
Gets the latitude of this site, in radians. Southern latitudes are negative.

Specified by:
getLatitude in interface Site
Returns:
The latitude in radians.

setLatitude

public void setLatitude(double phi)
Sets the latitude of this site, in radians. Southern latitudes are negative.

Specified by:
setLatitude in interface Site

getElevation

public double getElevation()
Gets the elevation of this site, in meters.

Specified by:
getElevation in interface Site

setElevation

public void setElevation(double height)
Sets the elevation of this site, in meters.

Specified by:
setElevation in interface Site

equals

public boolean equals(Object that)
Two sites are equal, if their geographical position and their height are identically.

Overrides:
equals in class Object
Returns:
True, if this two sites are equal.

toString

public String toString()
Returns a simple representation of this site. Longitude and latitude are printed in degrees for better readability.

Overrides:
toString in class Object