001    package edu.nrao.sss.model.project.scan;
002    
003    import edu.nrao.sss.util.EnumerationUtility;
004    
005    /**
006     * A representation of the "wrapping" of an antenna.
007     * <p>
008     * As an example, the VLA antennas can rotate 540 degrees in azimuth.
009     * An observer can request that an observation be set up so that it
010     * has the least likelihood to run into one of the stops.  The observer
011     * does this by specifying that the wrap be either clockwise or
012     * counterclockwise.</p>
013     * <p>
014     * <b>CVS Info:</b>
015     * <table style="margin-left:2em">
016     *   <tr><td>$Revision: 161 $</td></tr>
017     *   <tr><td>$Date: 2006-12-15 11:48:34 -0700 (Fri, 15 Dec 2006) $</td></tr>
018     *   <tr><td>$Author: btruitt $</td></tr>
019     * </table></p>
020     *  
021     * @author David M. Harland
022     * @since 2006-07-14
023     */
024    public enum AntennaWrap
025    {
026      CLOCKWISE,
027      
028      COUNTERCLOCKWISE,
029      
030      NO_PREFERENCE;
031    
032      /**
033       * Returns a default antenna wrap.
034       * @return a default antenna wrap.
035       */
036      public static AntennaWrap getDefault()
037      {
038        return NO_PREFERENCE;
039      }
040      
041      /**
042       * Returns a text representation of this enumeration constant.
043       * @return a text representation of this enumeration constant.
044       */
045      public String toString()
046      {
047        return EnumerationUtility.getSharedInstance().enumToString(this);
048      }
049      
050      /**
051       * Returns the antenna wrap represented by {@code text}.
052       * <p>
053       * For details about the transformation, see
054       * {@link EnumerationUtility#enumFromString(Class, String)}.</p>
055       * 
056       * @param text a text representation of an antenna wrap.
057       * 
058       * @return the antenna wrap represented by {@code text}.
059       */
060      public static AntennaWrap fromString(String text)
061      {
062        return EnumerationUtility.getSharedInstance()
063                                 .enumFromString(AntennaWrap.class, text);
064      }
065    }