net.grelf.astro
Class Dec

java.lang.Object
  extended by net.grelf.astro.Dec
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Dec
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Representation of declination (celestial latitude) in a compact form, just 4 bytes of data. Accurate to 0.1 seconds of arc.

See Also:
Serialized Form

Constructor Summary
Dec(double degrees)
           
Dec(double degrees, double mins, double secs)
          Can pass in fractional degrees or minutes but will be held in normalised form with integer degrees and minutes plus fractional seconds.
10.2.1 Important change: previously the degrees part could be negative but min and sec were expected to be positive (as from a user dialogue).
 
Method Summary
 Dec clone()
           
 boolean equals(java.lang.Object other)
           
 byte getDegree()
          Range -90..+90
 byte getMin()
          Range -59..59
 float getSec()
          Range -59.9..59.9
 int hashCode()
          Enable objects of this class to be used as hash keys.
 double toDegrees()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dec

public Dec(double degrees,
           double mins,
           double secs)
Can pass in fractional degrees or minutes but will be held in normalised form with integer degrees and minutes plus fractional seconds.
10.2.1 Important change: previously the degrees part could be negative but min and sec were expected to be positive (as from a user dialogue). BUT that will not work if the degrees part is zero. So...
VERY IMPORTANT: If the declination is negative every field in this constructor must be negative. Note that in a user dialogue (eg, in net.grelf.astro.StarChart) it can be different because each text field holds a String rather than a number so the sign is detectable on "-0".


Dec

public Dec(double degrees)
Method Detail

getDegree

public byte getDegree()
Range -90..+90


getMin

public byte getMin()
Range -59..59


getSec

public float getSec()
Range -59.9..59.9


toDegrees

public double toDegrees()

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Enable objects of this class to be used as hash keys.

Overrides:
hashCode in class java.lang.Object

clone

public Dec clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object