|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvisad.Unit
visad.PromiscuousUnit
public class PromiscuousUnit
PromiscuousUnit is the VisAD class for units that are convertable with any other Unit.
Method Summary | |
---|---|
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. |
java.lang.String |
getDefinition()
Returns the definition of this unit. |
boolean |
isConvertible(Unit unit)
Indicate whether this unit is convertible with another unit. |
boolean |
isDimensionless()
Indicates if this instance is dimensionless. |
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(java.lang.String identifier)
Clones this unit, changing the identifier. |
Unit |
root(int root)
Returns the N-th root of this unit. |
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. |
Methods inherited from class visad.Unit |
---|
adjustCheckAndCache, canConvert, canConvertArray, clone, convertTuple, convertTuple, copyUnitsArray, getAbsoluteUnit, getIdentifier, scale, shift, sqrt, toString, toThat, toThis, transformUnits, transformUnits |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public 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 Unit
protected Unit protectedClone(java.lang.String identifier) throws UnitException
protectedClone
in class Unit
identifier
- The name or abbreviation for the cloned unit.
May be null
or empty.
UnitException
- Promiscuous units may not be cloned. Always
thrown.public java.lang.String getDefinition()
getDefinition
in class Unit
null
but may be empty.public Unit pow(int power)
Unit
pow
in class Unit
power
- The power to raise this unit by.
public Unit root(int root)
Unit
root
in class Unit
root
- The root to take (e.g. 2 means square root). Must not
be zero.
root
-th root
of this unit.public Unit pow(double power)
Unit
pow
in class Unit
power
- The power to raise this unit by. If this unit is
not dimensionless, then the value must be integral.
power
.public Unit multiply(Unit that)
Unit
multiply
in class Unit
that
- The given unit to multiply this unit by.
public Unit divide(Unit that) throws UnitException
Unit
divide
in class Unit
that
- 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
Unit
divideInto
in class Unit
that
- The unit to be divided by this unit.
UnitException
- It's meaningless to divide these units.public double[] toThis(double[] values, Unit that)
Unit
toThis
in class Unit
values
- Values in units of the other unit.that
- The other unit.
public double[] toThat(double[] values, Unit that)
Unit
toThat
in class Unit
values
- The values in this unit.that
- The other unit.
public float[] toThis(float[] values, Unit that)
Unit
toThis
in class Unit
values
- Values in units of the other unit.that
- The other unit.
public float[] toThat(float[] values, Unit that)
Unit
toThat
in class Unit
values
- The values in this unit.that
- The other unit.
public boolean isConvertible(Unit unit)
isConvertible
in class Unit
unit
- The other unit.
public boolean equals(Unit unit)
Unit
equals
in class Unit
unit
- The unit.
true
if and only if this instance
equals the unit.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |