public final class PromiscuousUnit extends Unit
| Modifier and Type | Method and Description |
|---|---|
Unit |
divide(PromiscuousUnit that) |
Unit |
divide(Unit that)
Divide this unit by another unit.
|
protected Unit |
divideInto(Unit that)
Divide this unit into another unit.
|
boolean |
equals(Unit unit)
Indicates whether or not this instance is equal to a unit.
|
String |
getDefinition()
Returns the definition of this unit.
|
DerivedUnit |
getDerivedUnit()
Returns the dimensionless unit one with the identifier "1".
|
int |
hashCode()
Returns the hash code of this instance.
|
boolean |
isConvertible(Unit unit)
Indicate whether this unit is convertible with another unit.
|
boolean |
isDimensionless()
Indicates if this instance is dimensionless.
|
Unit |
log(double base)
Returns the logarithmic unit that has this unit as its reference level.
|
Unit |
multiply(Unit that)
Multiply this unit by another unit.
|
Unit |
pow(double power)
Raise a unit to a power.
|
Unit |
pow(int power)
Raise this unit to a power.
|
protected Unit |
protectedClone(String identifier)
Clones this unit, changing the identifier.
|
Unit |
root(int root)
Returns the N-th root of this unit.
|
Unit |
scale(double amount)
Scale this unit by an amount.
|
Unit |
shift(double offset)
Shift this unit by an amount.
|
double[] |
toThat(double[] values,
Unit that)
Convert values from this unit to another unit.
|
float[] |
toThat(float[] values,
Unit that)
Convert values from this unit to another unit.
|
double[] |
toThis(double[] values,
Unit that)
Convert values to this unit from another unit.
|
float[] |
toThis(float[] values,
Unit that)
Convert values to this unit from another unit.
|
adjustCheckAndCache, canConvert, canConvertArray, clone, convertTuple, convertTuple, convertTuple, convertTuple, copyUnitsArray, equals, getAbsoluteUnit, getIdentifier, main, sqrt, toString, toThat, toThat, toThat, toThis, toThis, toThis, transformUnits, transformUnits, transformUnits, transformUnitspublic boolean isDimensionless()
Indicates if this instance is dimensionless. A unit is dimensionless if it is a measure of a dimensionless quantity like angle or concentration. Examples of dimensionless units include radian, degree, steradian, and "g/kg".
This implementation always returns false because the typical
use of this method is to determine whether or not a function of
dimensionless values (e.g. sin(), log()) may be applied to values in this
unit and such functions shouldn't be applied to values in this unit.
Instead, the client should ensure that the values are in a true,
dimensionless unit.
isDimensionless in class Unitprotected Unit protectedClone(String identifier) throws UnitException
protectedClone in class Unitidentifier - The name or abbreviation for the cloned unit. May be
null or empty.UnitException - Promiscuous units may not be cloned. Always thrown.public String getDefinition()
getDefinition in class Unitnull
but may be empty.public Unit scale(double amount) throws UnitException
Unitscale in class Unitamount - The amount by which to scale this unit. E.g. Unit yard =
meter.scale(0.9144);UnitException - This unit cannot be scaled.public Unit shift(double offset) throws UnitException
Unitshift in class Unitoffset - The amount by which to shift this unit. E.g. Unit celsius =
kelvin.shift(273.15);UnitException - The unit subclass is unknown.public Unit log(double base)
Unitpublic Unit root(int root)
Unitpublic Unit multiply(Unit that)
Unitpublic Unit divide(Unit that) throws UnitException
Unitdivide in class Unitthat - The unit to divide into this unit.UnitException - It's meaningless to divide these units.public Unit divide(PromiscuousUnit that)
protected Unit divideInto(Unit that) throws UnitException
UnitdivideInto in class Unitthat - The unit to be divided by this unit.UnitException - It's meaningless to divide these units.public double[] toThis(double[] values,
Unit that)
Unitpublic double[] toThat(double[] values,
Unit that)
Unitpublic float[] toThis(float[] values,
Unit that)
Unitpublic float[] toThat(float[] values,
Unit that)
Unitpublic boolean isConvertible(Unit unit)
isConvertible in class Unitunit - The other unit.public boolean equals(Unit unit)
Unitpublic int hashCode()
Object.hashCode() should
be overridden whenever Object.equals(Object) is.public DerivedUnit getDerivedUnit()
getDerivedUnit in class UnitCopyright © 1996–2023 The SSEC Visualization Project. All rights reserved.