Method Summary |
|
final public AlternateUnit<A> | alternate(String symbol) Returns a unit equivalent to this unit but used in expressions to
distinguish between quantities of a different nature but of the same
dimensions.
Examples of alternate units:[code]
Unit RADIAN = ONE.alternate("rad");
Unit NEWTON = METER.times(KILOGRAM).divide(SECOND.pow(2)).alternate("N");
Unit PASCAL = NEWTON.divide(METER.pow(2)).alternate("Pa");
[/code]
Parameters: symbol - the new symbol for the alternate unit. |
final public Unit<T> | asType(Class<T> type) Casts this unit to a parameterized unit of specified nature or
throw a ClassCastException if the dimension of the
specified quantity and this unit's dimension do not match.
For example:[code]
Unit LIGHT_YEAR = NonSI.C.times(NonSI.YEAR).asType(Length.class);
[/code]
Parameters: type - the quantity class identifying the nature of the unit. |
final public CompoundUnit<Q> | compound(Unit<Q> subunit) Returns the combination of this unit with the specified sub-unit.
Compound units are typically used for formatting purpose. |
final public Unit<Q> | divide(long divisor) Returns the result of dividing this unit by an exact divisor.
Parameters: divisor - the exact divisor.(e.g. |
final public Unit<Q> | divide(double divisor) Returns the result of dividing this unit by an approximate divisor.
Parameters: divisor - the approximate divisor. |
final public Unit<? extends Quantity> | divide(Unit> that) Returns the quotient of this unit with the one specified.
Parameters: that - the unit divisor. |
abstract public boolean | equals(Object that) Indicates if the specified unit can be considered equals to
the one specified.
Parameters: that - the object to compare to. |
final public UnitConverter | getConverterTo(Unit> that) Returns a converter of numeric values from this unit to another unit.
Parameters: that - the unit to which to convert the numeric values. |
final public Dimension | getDimension() Returns the dimension of this unit (depends upon the current
dimensional
Dimension.Model model ). |
abstract public Unit<? super Q> | getStandardUnit() Returns the
BaseUnit base unit ,
AlternateUnit alternateunit or product of base units and alternate units this unit is derived
from. |
abstract public int | hashCode() Returns the hash code for this unit. |
final public Unit<? extends Quantity> | inverse() Returns the inverse of this unit. |
final public boolean | isCompatible(Unit> that) Indicates if this unit is compatible with the unit specified.
Units don't need to be equals to be compatible. |
public boolean | isStandardUnit() Indicates if this unit is a standard unit (base units and
alternate units are standard units). |
final public Unit<Q> | plus(double offset) Returns the result of adding an offset to this unit. |
final public Unit<? extends Quantity> | pow(int n) Returns a unit equals to this unit raised to an exponent.
Parameters: n - the exponent. |
final public Unit<? extends Quantity> | root(int n) Returns a unit equals to the given root of this unit.
Parameters: n - the root's order. |
final public Unit<Q> | times(long factor) Returns the result of multiplying this unit by an exact factor. |
final public Unit<Q> | times(double factor) Returns the result of multiplying this unit by a an approximate factor
Parameters: factor - the approximate factor (e.g. |
final public Unit<? extends Quantity> | times(Unit> that) Returns the product of this unit with the one specified.
Parameters: that - the unit multiplicand. |
abstract public UnitConverter | toStandardUnit() Returns the converter from this unit to its system unit. |
final public String | toString() Returns the standard String representation of this unit.
This representation is not affected by locale. |
final public Unit<Q> | transform(UnitConverter operation) Returns the unit derived from this unit using the specified converter.
The converter does not need to be linear. |
public static Unit<? extends Quantity> | valueOf(CharSequence csq) Returns a unit instance that is defined from the specified
character sequence using the
UnitFormat.getInstancestandard unit format .
Examples of valid entries (all for meters per second squared) are:
- m*s-2
- m/s²
- m·s-²
- m*s**-2
- m^+1 s^-2
Parameters: csq - the character sequence to parse. |