001    package edu.nrao.sss.model.project;
002    
003    import edu.nrao.sss.util.EnumerationUtility;
004    
005    /**
006     * Constraints related to scheduling an observation.
007     * <p>
008     * A constraint of {@link #NONE} means that there are no constraints
009     * related to scheduling a given object for observation.  All other
010     * elements of this enumeration indicate there is some reason why
011     * the object cannot be scheduled.</p>
012     * <p>
013     * <b>Version Info:</b>
014     * <table style="margin-left:2em">
015     *   <tr><td>$Revision: 1417 $</td></tr>
016     *   <tr><td>$Date: 2008-07-16 10:15:30 -0600 (Wed, 16 Jul 2008) $</td></tr>
017     *   <tr><td>$Author: dharland $ (last person to modify)</td></tr>
018     * </table></p>
019     * 
020     * @author David M. Harland
021     * @since 2006-03-19
022     */
023    public enum SchedulingConstraint
024    {
025      NONE,
026      
027      @Deprecated WEATHER,
028      
029      WIND_SPEED,
030      
031      ATMOSPHERIC_PHASE,
032      
033      IONOSPHERIC_PHASE,
034      
035      SOLAR_SEPARATION,
036      
037      NEAR_SUNRISE,
038      
039      NEAR_SUNSET,
040      
041      TIME,
042      
043      PREREQUISITE,
044      
045      SCHEDULING_STATUS,
046      
047      OTHER;
048    
049      /**
050       * Returns a default scheduling constraint.
051       * @return a default scheduling constraint.
052       */
053      public static SchedulingConstraint getDefault()
054      {
055        return OTHER;
056      }
057      
058      /**
059       * Returns a text representation of this enumeration constant.
060       * @return a text representation of this enumeration constant.
061       */
062      public String toString()
063      {
064        return EnumerationUtility.getSharedInstance().enumToString(this);
065      }
066      
067      /**
068       * Returns the scheduling constraint represented by {@code text}.
069       * <p>
070       * For details about the transformation, see
071       * {@link EnumerationUtility#enumFromString(Class, String)}.</p>
072       * 
073       * @param text a text representation of a scheduling constraint.
074       * 
075       * @return the scheduling constraint represented by {@code text}.
076       */
077      public static SchedulingConstraint fromString(String text)
078      {
079        return EnumerationUtility.getSharedInstance()
080                                 .enumFromString(SchedulingConstraint.class, text);
081      }
082    }