ucar.units
Class UnitID

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

public abstract class UnitID
extends Object
implements 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  String getName()
          Returns the name of the unit.
abstract  String getPlural()
          Returns the plural form of the name of the unit.
abstract  String getSymbol()
          Returns the symbol for the unit.
static UnitID newUnitID(String name, String plural, String symbol)
          Factory method for constructing an identifier from a name, plural, and symbol.
abstract  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(String name,
                               String plural,
                               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 String getName()
Returns the name of the unit.

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

getPlural

public abstract 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 String getSymbol()
Returns the symbol for the unit.

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

toString

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

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


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.