net.grelf.astro
Class Epoch

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

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

Represent astronomical epochs, such as B1950.0 or J2010.0. The IAU changed the standard from Besselian to Julian as from 1984. Besselian epochs use tropical years of 365.2421988 days. The Julian system is in some ways simpler because it uses years of exactly 365.25 days. Epoch B1950.0 was JDE 2433282.4235. Epoch J2000.0 was JDE 2451545.0 exactly.

See Also:
Serialized Form

Field Summary
static Epoch J2000
           
 
Constructor Summary
Epoch(char type, float year)
          Creates an Epoch with any type letter (but it must be 'B' or 'J' to make sense astronomically).
Epoch(float year)
          Creates an Epoch assuming the type letter is 'J'.
 
Method Summary
 Epoch clone()
          Returns a new Epoch object with the same data.
 boolean equals(java.lang.Object other)
           
 JulianDate getJulianDate()
          Returns null if the epoch type is not 'B' or 'J'.
 char getType()
          'J' or 'B'.
 float getYear()
           
 int hashCode()
          Enable objects of this class to be used as hash keys.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

J2000

public static final Epoch J2000
Constructor Detail

Epoch

public Epoch(float year)
Creates an Epoch assuming the type letter is 'J'.


Epoch

public Epoch(char type,
             float year)
Creates an Epoch with any type letter (but it must be 'B' or 'J' to make sense astronomically).

Method Detail

getYear

public float getYear()

getType

public char getType()
'J' or 'B'.


getJulianDate

public JulianDate getJulianDate()
Returns null if the epoch type is not 'B' or 'J'.


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 Epoch clone()
Returns a new Epoch object with the same data.

Overrides:
clone in class java.lang.Object

toString

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