ucar.units
Class UnitID

java.lang.Object
  extended by ucar.units.UnitID
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UnitName, UnitSymbol

public abstract class UnitID
extends java.lang.Object
implements java.io.Serializable

Provides support for unit identifiers.

Version:
$Id: UnitID.java 64 2006-07-12 22:30:50Z edavis $
Author:
Steven R. Emmerson
See Also:
Serialized Form

Constructor Summary
UnitID()
           
 
Method Summary
abstract  java.lang.String getName()
          Returns the name of the unit.
abstract  java.lang.String getPlural()
          Returns the plural form of the name of the unit.
abstract  java.lang.String getSymbol()
          Returns the symbol for the unit.
static UnitID newUnitID(java.lang.String name, java.lang.String plural, java.lang.String symbol)
          Factory method for constructing an identifier from a name, plural, and symbol.
abstract  java.lang.String toString()
          Returns the string representation of this identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnitID

public UnitID()
Method Detail

newUnitID

public static UnitID newUnitID(java.lang.String name,
                               java.lang.String plural,
                               java.lang.String symbol)
Factory method for constructing an identifier from a name, plural, and symbol.

Parameters:
name - The name for the unit. May be null .
plural - The plural form of the name. If null and name is non- null, then regular plural-forming rules are used on the name.
symbol - The symbol for the unit. May be null .

getName

public abstract java.lang.String getName()
Returns the name of the unit.

Returns:
The name of the unit. May be null.

getPlural

public abstract java.lang.String getPlural()
Returns the plural form of the name of the unit.

Returns:
The plural form of the name of the unit. May be null.

getSymbol

public abstract java.lang.String getSymbol()
Returns the symbol for the unit.

Returns:
The symbol for the unit. May be null.

toString

public abstract java.lang.String toString()
Returns the string representation of this identifier.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this identifier.