001    package edu.nrao.sss.model.project;
002    
003    import edu.nrao.sss.util.EnumerationUtility;
004    
005    /**
006     * An enumeration of project types.
007     * <p>
008     * The list of project types is based on an email from
009     * Barry Clark to evla-sw-discuss@nrao.edu on
010     * 2005-11-17.
011     * It was then modified based on an email reply from
012     * B.Clark to D.Harland on 2008-01-10 regarding the
013     * overlap between ProjectType and SchedulingType. 
014     * </p>
015     * <p>
016     * <b>Version Info:</b>
017     * <table style="margin-left:2em">
018     *   <tr><td>$Revision: 1233 $</td></tr>
019     *   <tr><td>$Date: 2008-04-22 09:25:07 -0600 (Tue, 22 Apr 2008) $</td></tr>
020     *   <tr><td>$Author: dharland $</td></tr>
021     * </table></p>
022     * 
023     * @since 2006-03-03
024     */
025    public enum ProjectType
026    {
027      /**
028       * Denotes a simple project.
029       */
030      SIMPLE,
031      
032      /**
033       * Denotes a large project.
034       * <blockquote><i>
035       * Find permitted scheduling density. Priority becomes low if recent
036       * observations at the current LST total more than permitted density.
037       * (So other projects can get a little time spread through the
038       * configuration.) 
039       * </i><br/>-- Barry Clark, from email to D.Harland, 2008-Jan-10 
040       * </blockquote>
041       */
042      LARGE,
043      
044      /**
045       * Denotes an adjustable project.
046       * <blockquote><i>
047       * Most projects will, in the scheduling process, receive an extra
048       * priority boost to finish up allocated time. ADJUSTable ones do not.
049       * (All time is welcome, and is useful without the whole lot.)
050       * </i><br/>-- Barry Clark, from email to D.Harland, 2008-Jan-10 
051       * </blockquote>
052       */
053      ADJUST,
054      
055      /**
056       * Denotes a project that uses multiple array configurations.
057       * <blockquote><i>
058       * If scheduled observing time in previous configurations is greater
059       * than requested for this configuration, increase scheduling priority
060       * to get it finished. 
061       * </i><br/>-- Barry Clark, from email to D.Harland, 2008-Jan-10 
062       * </blockquote>
063       */
064      MULTICONFIG;
065    
066      /**
067       * Returns a default project type.
068       * @return a default project type.
069       */
070      public static ProjectType getDefault()
071      {
072        return SIMPLE;
073      }
074      
075      /**
076       * Returns a text representation of this enumeration constant.
077       * @return a text representation of this enumeration constant.
078       */
079      public String toString()
080      {
081        return EnumerationUtility.getSharedInstance().enumToString(this);
082      }
083      
084      /**
085       * Returns the project type represented by {@code text}.
086       * <p>
087       * For details about the transformation, see
088       * {@link EnumerationUtility#enumFromString(Class, String)}.</p>
089       * 
090       * @param text a text representation of a project type.
091       * 
092       * @return the project type represented by {@code text}.
093       */
094      public static ProjectType fromString(String text)
095      {
096        return EnumerationUtility.getSharedInstance()
097                                 .enumFromString(ProjectType.class, text);
098      }
099    }