Class Unit
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.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
-
-
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 booleanequals(java.lang.Object o)java.lang.StringgetDescription()Description text to be included in XML documentation.doublegetExtent()Returns the extent along an axis in some externally-defined units represented by this object.java.lang.StringgetLabel()Returns the label, suitable for user interface selection.java.lang.StringgetSymbol()Returns the unit symbol, suitable for use in unit metadata.java.lang.StringgetTextName()Returns the name suitable for use in descriptive text.inthashCode()java.lang.StringtoString()Returns the label.
-
-
-
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 interfacetextName- text to appear in user-directed descriptive textsymbol- text to appear as unit metadata, preferably compatible with the VOUnit standardextent- distance along an axis in some externally-defined unitsdescription- 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
Returns the label.- Overrides:
toStringin classjava.lang.Object
-
-