|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.units.UnitImpl
ucar.units.DerivedUnitImpl
ucar.units.BaseUnit
public class BaseUnit
Provides support for base units.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ucar.units.UnitImpl |
|---|
UnitImpl.MyConverter |
| Field Summary |
|---|
| Fields inherited from class ucar.units.DerivedUnitImpl |
|---|
DIMENSIONLESS |
| Constructor Summary | |
|---|---|
protected |
BaseUnit(UnitName id,
BaseQuantity baseQuantity)
Constructs from identifiers and a base quantity. |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object object)
Indicates if this base unit is semantically identical to an object. |
BaseQuantity |
getBaseQuantity()
Returns the base quantity associated with this base unit. |
java.lang.String |
getID()
Returns the identifier for this base unit. |
static BaseUnit |
getOrCreate(UnitName id,
BaseQuantity baseQuantity)
Factory method for creating a new BaseUnit or obtaining a previously-created one. |
boolean |
isDimensionless()
Indicates if this base unit is dimensionless. |
static void |
main(java.lang.String[] args)
Tests this class. |
java.lang.String |
toString()
Returns the string representation of this base unit. |
| 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 |
| Constructor Detail |
|---|
protected BaseUnit(UnitName id,
BaseQuantity baseQuantity)
throws NameException
id - The identifiers for the base unit.
id.getSymbol() shall not return
null.baseQuantity - The base quantity of the base unit.
NameException - id.getSymbol() returned
null.| Method Detail |
|---|
public static BaseUnit getOrCreate(UnitName id,
BaseQuantity baseQuantity)
throws NameException,
UnitExistsException
id - The identifier for the base unit.
id.getSymbol() shall not return
null.baseQuantity - The base quantity of the base unit.
NameException - id.getSymbol() returned
null.
UnitExistsException - Attempt to incompatibly redefine an
existing base unit.public final BaseQuantity getBaseQuantity()
public final java.lang.String getID()
getSymbol().
getID in interface Basepublic final java.lang.String toString()
getID().
toString in interface UnittoString in class DerivedUnitImplpublic boolean equals(java.lang.Object object)
equals in interface Baseequals in interface Unitequals in class DerivedUnitImplobject - The object.
true if and only if this base
unit is semantically identical to
object.public boolean isDimensionless()
isDimensionless in interface BaseisDimensionless in interface UnitisDimensionless in class DerivedUnitImpltrue if and only if this base unit
is dimensionless (e.g. "radian").
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||