@Immutable public class BaseUnit extends DerivedUnitImpl implements Base
UnitImpl.MyConverterDIMENSIONLESS| Modifier | Constructor and Description |
|---|---|
protected |
BaseUnit(UnitName id,
BaseQuantity baseQuantity)
Constructs from identifiers and a base quantity.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.lang.String |
toString()
Returns the string representation of this base unit.
|
clone, equals, fromDerivedUnit, fromDerivedUnit, fromDerivedUnit, fromDerivedUnit, getCanonicalString, getDerivedUnit, getDimension, getQuantityDimension, hashCode, isCompatible, isReciprocalOf, myDivideBy, myDivideInto, myMultiplyBy, myRaiseTo, setDimension, toDerivedUnit, toDerivedUnit, toDerivedUnit, toDerivedUnitconvertTo, convertTo, convertTo, convertTo, convertTo, convertTo, divideBy, divideInto, getConverterTo, getName, getPlural, getSymbol, getUnitName, log, makeLabel, multiplyBy, multiplyBy, raiseTo, shiftTo, shiftToclone, finalize, getClass, notify, notifyAll, wait, wait, waitconvertTo, convertTo, convertTo, convertTo, convertTo, convertTo, divideBy, divideInto, getConverterTo, getName, getPlural, getSymbol, getUnitName, log, makeLabel, multiplyBy, multiplyBy, raiseTo, shiftTo, shiftToprotected 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.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().public final java.lang.String toString()
getID().toString in interface UnittoString in class DerivedUnitImplpublic boolean isDimensionless()
isDimensionless in interface BaseisDimensionless in interface UnitisDimensionless in class DerivedUnitImpltrue if and only if this base unit is dimensionless
(e.g. "radian").