|
||||||||||
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 | |
---|---|
BaseQuantity |
getBaseQuantity()
Returns the base quantity associated with this base unit. |
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(String[] args)
Tests this class. |
String |
toString()
Returns the string representation of this base unit. |
Methods inherited from class ucar.units.DerivedUnitImpl |
---|
clone, equals, fromDerivedUnit, fromDerivedUnit, fromDerivedUnit, fromDerivedUnit, getCanonicalString, getDerivedUnit, getDimension, getQuantityDimension, hashCode, 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, log, makeLabel, multiplyBy, multiplyBy, raiseTo, shiftTo, shiftTo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ucar.units.Base |
---|
equals |
Methods inherited from interface ucar.units.Unit |
---|
convertTo, convertTo, convertTo, convertTo, convertTo, convertTo, divideBy, divideInto, getConverterTo, getName, getPlural, getSymbol, getUnitName, log, makeLabel, multiplyBy, multiplyBy, raiseTo, shiftTo, shiftTo |
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 String getID()
getSymbol()
.
getID
in interface Base
public final String toString()
getID()
.
toString
in interface Unit
toString
in class DerivedUnitImpl
public boolean isDimensionless()
isDimensionless
in interface Base
isDimensionless
in interface Unit
isDimensionless
in class DerivedUnitImpl
true
if and only if this base unit is dimensionless
(e.g. "radian").public static void main(String[] args) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |