uk.me.nxg.unity
Class UnitDefinition.Syntax

java.lang.Object
  extended by uk.me.nxg.unity.UnitDefinition.Syntax
All Implemented Interfaces:
Serializable
Enclosing class:
UnitDefinition

public class UnitDefinition.Syntax
extends Object
implements Serializable

Describes the per-syntax information about a unit.

See Also:
Serialized Form

Method Summary
 List<String> getAbbrevs()
          Indicates how this unit is described in this syntax.
 String getOneAbbrev()
          Get a single abbrev for this unit.
 boolean isDeprecated()
          Indicates whether this syntax deprecates (but still permits) the use of this unit.
 String latexAbbrev()
          Get a version of an abbrev, suitable for outputting as part of the LaTeX representation of this unit.
 boolean mayHaveSIPrefixes()
          Indicates whether this unit may be used with SI prefixes.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAbbrevs

public List<String> getAbbrevs()
Indicates how this unit is described in this syntax. For example, the unit 'metre' will typically be representable by only 'm', in which case the return value would be ["m"].

Returns:
a list of permitted string representations of this unit in this syntax (usually just one member, but more are permissable)

getOneAbbrev

public String getOneAbbrev()
Get a single abbrev for this unit. If there is more than one allowable for this syntax, it is unspecified which one is returned.

Returns:
an abbreviation for this unit (there will always be at least one)

latexAbbrev

public String latexAbbrev()
Get a version of an abbrev, suitable for outputting as part of the LaTeX representation of this unit. This will generally be the unit abbrev, unless this has been overridden.

Returns:
an abbrev, which is non-empty

mayHaveSIPrefixes

public boolean mayHaveSIPrefixes()
Indicates whether this unit may be used with SI prefixes.


isDeprecated

public boolean isDeprecated()
Indicates whether this syntax deprecates (but still permits) the use of this unit.


toString

public String toString()
Overrides:
toString in class Object