ucar.units
Class UnknownUnit
java.lang.Object
ucar.units.UnitImpl
ucar.units.DerivedUnitImpl
ucar.units.BaseUnit
ucar.units.UnknownUnit
- All Implemented Interfaces:
- java.io.Serializable, Base, DerivableUnit, DerivedUnit, Unit
public final class UnknownUnit
- extends BaseUnit
Provides support for unknown base units. This can be used, for example,
to accomodate an unknown unit (e.g. "foo"). Values in such a unit will
only be convertible with units derived from "foo" (e.g. "20 foo").
- Version:
- $Id: UnknownUnit.java 64 2006-07-12 22:30:50Z edavis $
- Author:
- Steven R. Emmerson
- See Also:
- Serialized Form
|
Method Summary |
static UnknownUnit |
create(java.lang.String name)
Factory method for constructing an unknown unit from a name. |
boolean |
equals(java.lang.Object object)
Indicates if this unit is semantically identical to an object. |
boolean |
isDimensionless()
Indicates if this unit is dimensionless. |
static void |
main(java.lang.String[] args)
Tests this class. |
| Methods inherited from class ucar.units.DerivedUnitImpl |
clone, fromDerivedUnit, fromDerivedUnit, fromDerivedUnit, fromDerivedUnit, getCanonicalString, getDerivedUnit, getDimension, getQuantityDimension, isCompatible, isReciprocalOf, myDivideBy, myDivideInto, myMultiplyBy, myRaiseTo, setDimension, toDerivedUnit, toDerivedUnit, toDerivedUnit, toDerivedUnit |
| Methods inherited from class ucar.units.UnitImpl |
convertTo, convertTo, convertTo, convertTo, convertTo, convertTo, divideBy, divideInto, getConverterTo, getName, getPlural, getSymbol, getUnitName, makeLabel, multiplyBy, raiseTo |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ucar.units.Unit |
convertTo, convertTo, convertTo, convertTo, convertTo, convertTo, divideBy, divideInto, getConverterTo, getName, getPlural, getSymbol, getUnitName, makeLabel, multiplyBy, raiseTo |
create
public static UnknownUnit create(java.lang.String name)
throws NameException
- Factory method for constructing an unknown unit from a name.
- Parameters:
name - The name of the unit.
- Returns:
- The unknown unit.
- Throws:
NameException - name == null.
equals
public boolean equals(java.lang.Object object)
- Indicates if this unit is semantically identical to an object.
- Specified by:
equals in interface Base- Specified by:
equals in interface Unit- Overrides:
equals in class BaseUnit
- Parameters:
object - The object.
- Returns:
true if and ony if the object
is this unit.
isDimensionless
public boolean isDimensionless()
- Indicates if this unit is dimensionless. An unknown unit is never
dimensionless.
- Specified by:
isDimensionless in interface Base- Specified by:
isDimensionless in interface Unit- Overrides:
isDimensionless in class BaseUnit
- Returns:
false always.
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Tests this class.
- Throws:
java.lang.Exception