edu.nrao.sss.astronomy
Enum Epoch

java.lang.Object
  extended by java.lang.Enum<Epoch>
      extended by edu.nrao.sss.astronomy.Epoch
All Implemented Interfaces:
Serializable, Comparable<Epoch>

public enum Epoch
extends Enum<Epoch>

An enumeration of astronomical epochs.

An epoch in astronomy is a point in time for which celestial positions are specified. See Wikipedia for more information.

Since:
2006-03-02
Author:
David M. Harland

Enum Constant Summary
B1950
          Besselian epoch B1950.0.
J2000
          Julian epoch J2000.0.
UNKNOWN
          An unknown proposal status.
 
Method Summary
static Epoch fromString(String text)
          Returns an epoch for the given text.
static Epoch getDefault()
          Returns a default epoch.
 String toString()
          Returns a text representation of this enumeration constant.
static Epoch valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Epoch[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

B1950

public static final Epoch B1950
Besselian epoch B1950.0. See Wikipedia for more information.


J2000

public static final Epoch J2000
Julian epoch J2000.0. See Wikipedia for more information.


UNKNOWN

public static final Epoch UNKNOWN
An unknown proposal status. This element is used to implement the Null Object Pattern. In situations where a method might be tempted to return null, this element is returned instead.

Method Detail

values

public static Epoch[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Epoch c : Epoch.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Epoch valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getDefault

public static Epoch getDefault()
Returns a default epoch.

Returns:
a default epoch.

toString

public String toString()
Returns a text representation of this enumeration constant.

Overrides:
toString in class Enum<Epoch>
Returns:
a text representation of this enumeration constant.

fromString

public static Epoch fromString(String text)
Returns an epoch for the given text.

The format of text is somewhat forgiving, in that the search is not case-sensitive and will ignore leading and/or trailing whitespace. In addition, several forms of the name are permitted. For example, both "J2000" and "J2000.0" will be resolved to J2000.

If no epoch can be found for text, UNKNOWN is returned.

Parameters:
text - the name of an epoch.
Returns:
an epoch for name.


Copyright © 2009. All Rights Reserved.