001 package edu.nrao.sss.astronomy; 002 003 import edu.nrao.sss.util.EnumerationUtility; 004 005 /** 006 * An indicator for the form in which position information is held. 007 * <p> 008 * <b>Version Info:</b> 009 * <table style="margin-left:2em"> 010 * <tr><td>$Revision: 550 $</td></tr> 011 * <tr><td>$Date: 2007-04-22 12:25:08 -0600 (Sun, 22 Apr 2007) $</td></tr> 012 * <tr><td>$Author: dharland $</td></tr> 013 * </table></p> 014 * 015 * @author David M. Harland 016 * @since 2007-04-18 017 */ 018 public enum SkyPositionType 019 { 020 /** 021 * The simplest form of position information. This typically means 022 * that the position is not stored as a function of time. 023 */ 024 SIMPLE, 025 026 /** 027 * Position information stored as a single polynomial equation. 028 * equations where the independent variable is time. 029 */ 030 POLYNOMIAL, 031 032 /** 033 * Position information stored as a series of one or more polynomial 034 * equations where the independent variable is time. 035 */ 036 POLYNOMIAL_TABLE, 037 038 /** 039 * Position information stored as orbital elements. 040 */ 041 ORBITAL_ELEMENTS, 042 043 /** 044 * Position information stored as an ephemeris table. 045 */ 046 EPHEMERIS_TABLE, 047 048 /** 049 * Position information stored as the name of a body that can 050 * later be turned into an ephemeris table. 051 */ 052 INTERNAL_EPHEMERIS; 053 054 /** 055 * Returns a default source position type. 056 * @return a default source position type. 057 */ 058 public static SkyPositionType getDefault() 059 { 060 return SIMPLE; 061 } 062 063 /** 064 * Returns a text representation of this enumeration constant. 065 * @return a text representation of this enumeration constant. 066 */ 067 public String toString() 068 { 069 return EnumerationUtility.getSharedInstance().enumToString(this); 070 } 071 072 /** 073 * Returns the source position type represented by {@code text}. 074 * <p> 075 * For details about the transformation, see 076 * {@link EnumerationUtility#enumFromString(Class, String)}.</p> 077 * 078 * @param text a text representation of a source position type. 079 * 080 * @return the source position type represented by {@code text}. 081 */ 082 public static SkyPositionType fromString(String text) 083 { 084 return EnumerationUtility.getSharedInstance() 085 .enumFromString(SkyPositionType.class, text); 086 } 087 }