001    package edu.nrao.sss.model.source;
002    
003    import edu.nrao.sss.util.EnumerationUtility;
004    
005    /**
006     * The distribution of the brightness of an astronomical source.
007     * <p>
008     * <b>Version Info:</b>
009     * <table style="margin-left:2em">
010     *   <tr><td>1.3</td>
011     *   <tr><td>2006/05/22 16:23:44</td>
012     *   <tr><td>dharland</td>
013     * </table></p>
014     * 
015     * @author David M. Harland
016     * @since 2006-04-04
017     */
018    public enum BrightnessDistribution
019    {
020      /** A point distribution. */
021      POINT,
022      
023      /** A gaussian distribution. */
024      GAUSSIAN,
025      
026      /** A disk-shaped distribution. */
027      DISK,
028      
029      /**
030       * A distribution described by a   
031       * <a href="http://fits.gsfc.nasa.gov/">Flexible Image Transport System</a>
032       * file.
033       */
034      FITS_FILE
035      {
036        @Override public String toString() { return "FITS File"; }
037      },
038      
039      /** A distribution described by a Clean Components file. */ 
040      CLEAN_COMPONENTS_FILE
041      {
042        @Override public String toString() { return "CLEAN Components File"; }
043      },
044      
045      /** A brightness distribution of unknown type. */
046      UNKNOWN;
047    
048      /**
049       * Returns a default brightness distribution.
050       * @return a default brightness distribution.
051       */
052      public static BrightnessDistribution getDefault()
053      {
054        return UNKNOWN;
055      }
056      
057      /**
058       * Returns a text representation of this enumeration constant.
059       * @return a text representation of this enumeration constant.
060       */
061      public String toString()
062      {
063        return EnumerationUtility.getSharedInstance().enumToString(this);
064      }
065      
066      /**
067       * Returns the brightness distribution represented by {@code text}.
068       * <p>
069       * For details about the transformation, see
070       * {@link EnumerationUtility#enumFromString(Class, String)}.</p>
071       * 
072       * @param text a text representation of a brightness distribution.
073       * 
074       * @return the brightness distribution represented by {@code text}.
075       */
076      public static BrightnessDistribution fromString(String text)
077      {
078        return EnumerationUtility.getSharedInstance()
079                                 .enumFromString(BrightnessDistribution.class, text);
080      }
081    }