Class Unit

  • Direct Known Subclasses:
    SolidAngleUnit, TimeUnit

    @Equality
    public class Unit
    extends java.lang.Object
    Defines a numeric factor corresponding to an extent on an axis. Functionally, this is just a labelled double precision value, but it has the semantics of a scaling factor along a plot axis.
    Since:
    11 Jan 2018
    Author:
    Mark Taylor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Unit UNIT
      Unit instance with value of unity.
    • Constructor Summary

      Constructors 
      Constructor Description
      Unit​(java.lang.String label, java.lang.String textName, java.lang.String symbol, double extent, java.lang.String description)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getDescription()
      Description text to be included in XML documentation.
      double getExtent()
      Returns the extent along an axis in some externally-defined units represented by this object.
      java.lang.String getLabel()
      Returns the label, suitable for user interface selection.
      java.lang.String getSymbol()
      Returns the unit symbol, suitable for use in unit metadata.
      java.lang.String getTextName()
      Returns the name suitable for use in descriptive text.
      int hashCode()  
      java.lang.String toString()
      Returns the label.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • UNIT

        public static final Unit UNIT
        Unit instance with value of unity.
    • Constructor Detail

      • Unit

        public Unit​(java.lang.String label,
                    java.lang.String textName,
                    java.lang.String symbol,
                    double extent,
                    java.lang.String description)
        Constructor.
        Parameters:
        label - text to appear in a selection interface
        textName - text to appear in user-directed descriptive text
        symbol - text to appear as unit metadata, preferably compatible with the VOUnit standard
        extent - distance along an axis in some externally-defined units
        description - textual description to be included in XML
    • Method Detail

      • getLabel

        public java.lang.String getLabel()
        Returns the label, suitable for user interface selection.
        Returns:
        label
      • getTextName

        public java.lang.String getTextName()
        Returns the name suitable for use in descriptive text.
        Returns:
        text name
      • getSymbol

        public java.lang.String getSymbol()
        Returns the unit symbol, suitable for use in unit metadata.
        Returns:
        symbol, preferably VOUnit-compatible
      • getDescription

        public java.lang.String getDescription()
        Description text to be included in XML documentation.
        Returns:
        XML-friendly descriptive text
      • getExtent

        public double getExtent()
        Returns the extent along an axis in some externally-defined units represented by this object.
        Returns:
        extent
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Returns the label.
        Overrides:
        toString in class java.lang.Object