001    package edu.nrao.sss.model.resource;
002    
003    import edu.nrao.sss.util.EnumerationUtility;
004    
005    /**
006     * An enumeration of known interferometer correlators. 
007     * <p>
008     * This enumeration has the same name, and elements that have the same
009     * names and are in the same order, as the corresponding
010     * <a href="http://almasw.hq.eso.org/almasw/bin/view/HLA/GeneratedEnums#CorrelatorName">
011     * ALMA enumeration</a>.</p>
012     * <p>
013     * <p>
014     * <b>Version Info:</b>
015     * <table style="margin-left:2em">
016     *   <tr><td>$Revision: 1196 $</td></tr>
017     *   <tr><td>$Date: 2008-03-31 09:48:16 -0600 (Mon, 31 Mar 2008) $</td></tr>
018     *   <tr><td>$Author: dharland $ (last person to modify)</td></tr>
019     * </table></p>
020     * 
021     * @author David M. Harland
022     * @since 2008-01-31
023     */
024    public enum CorrelatorName
025    {
026      ALMA_ACA(null),
027      
028      ALMA_BASELINE(null),
029    
030      ALMA_BASELINE_ATF(null),
031    
032      ALMA_BASELINE_PROTO_OSF(null),
033    
034      HERSCHEL(null),
035    
036      IRAM_PDB(null),
037    
038      IRAM_30M_VESPA(null),
039    
040      IRAM_WILMA(null),
041    
042      VLA("VLA Correlator"),
043      
044      WIDAR(null);
045      
046      private String displayText;
047      
048      private CorrelatorName(String dispText)
049      {
050        displayText = dispText;
051      }
052      
053      @Override
054      public String toString()
055      {
056        return displayText == null ? name().replace('_', ' ') : displayText;
057      }
058      
059      /**
060       * Returns the type of correlator represented by {@code text}.
061       * <p>
062       * For details about the transformation, see
063       * {@link EnumerationUtility#enumFromString(Class, String)}.</p>
064       * 
065       * @param text a text representation of a type of correlator.
066       * 
067       * @return the type of correlator represented by {@code text}.
068       */
069      public static CorrelatorName fromString(String text)
070      {
071        return EnumerationUtility.getSharedInstance()
072                                 .enumFromString(CorrelatorName.class, text);
073      }
074    
075      //============================================================================
076      // 
077      //============================================================================
078      /*
079      public static void main(String[] args)
080      {
081        for (CorrelatorName corr : CorrelatorName.values())
082        {
083          System.out.print(corr.name());
084          System.out.print(", ");
085          System.out.print(corr.toString());
086          System.out.println();
087        }
088      }
089      */
090    }