|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Unit
Interface for units.
| Method Summary | |
|---|---|
Unit |
clone(UnitName id)
Clones this unit, changing the identifier. |
double[] |
convertTo(double[] amounts,
Unit outputUnit)
Converts numerical values from this unit to another unit. |
double[] |
convertTo(double[] input,
Unit outputUnit,
double[] output)
Converts numerical values from this unit to another unit. |
double |
convertTo(double amount,
Unit outputUnit)
Converts a numerical value from this unit to another unit. |
float[] |
convertTo(float[] amounts,
Unit outputUnit)
Converts numerical values from this unit to another unit. |
float[] |
convertTo(float[] input,
Unit outputUnit,
float[] output)
Converts numerical values from this unit to another unit. |
float |
convertTo(float amount,
Unit outputUnit)
Converts a numerical value from this unit to another unit. |
Unit |
divideBy(Unit that)
Divides this unit by another. |
Unit |
divideInto(Unit that)
Divides this unit into another. |
boolean |
equals(java.lang.Object object)
Indicates if this unit is semantically identical to an object. |
java.lang.String |
getCanonicalString()
Returns the canonical string representation of the unit. |
Converter |
getConverterTo(Unit outputUnit)
Gets a Converter that converts numeric values from this unit to another, compatible unit. |
DerivedUnit |
getDerivedUnit()
Returns the derived unit that underlies this unit. |
java.lang.String |
getName()
Gets the name of this unit. |
java.lang.String |
getPlural()
Gets the plural form of the name of this unit. |
java.lang.String |
getSymbol()
Gets the symbol of this unit. |
UnitName |
getUnitName()
Gets the identifier of this unit. |
boolean |
isCompatible(Unit that)
Indicates if this unit is compatible with another unit. |
boolean |
isDimensionless()
Indicates if values in this unit are dimensionless. |
java.lang.String |
makeLabel(java.lang.String quantityID)
Makes a label for a named quantity. |
Unit |
multiplyBy(Unit that)
Multiplies this unit by another. |
Unit |
raiseTo(int power)
Raises this unit to a power. |
java.lang.String |
toString()
Returns the string representation of the unit. |
| Method Detail |
|---|
UnitName getUnitName()
java.lang.String getName()
java.lang.String getPlural()
java.lang.String getSymbol()
java.lang.String toString()
toString in class java.lang.Objectjava.lang.String getCanonicalString()
DerivedUnit getDerivedUnit()
Unit clone(UnitName id)
id - The identifier for the new unit.
Unit multiplyBy(Unit that)
throws MultiplyException
that - The other unit.
MultiplyException - Can't multiply these units.
Unit divideBy(Unit that)
throws OperationException
that - The other unit.
OperationException - Can't divide these units.
Unit divideInto(Unit that)
throws OperationException
that - The other unit.
OperationException - Can't divide these units.
Unit raiseTo(int power)
throws RaiseException
power - The power.
RaiseException - Can't raise this unit to a power.
Converter getConverterTo(Unit outputUnit)
throws ConversionException
outputUnit - The unit to which to convert the numerical
values.
ConversionException - The units aren't compatible.
float convertTo(float amount,
Unit outputUnit)
throws ConversionException
amount - The numerical value in this unit.outputUnit - The unit to which to convert the numerical
value.
ConversionException - The units aren't compatible.
double convertTo(double amount,
Unit outputUnit)
throws ConversionException
amount - The numerical value in this unit.outputUnit - The unit to which to convert the numerical
value.
ConversionException - The units aren't compatible.
float[] convertTo(float[] amounts,
Unit outputUnit)
throws ConversionException
amounts - The numerical values in this unit.outputUnit - The unit to which to convert the numerical
values.
ConversionException - The units aren't compatible.
double[] convertTo(double[] amounts,
Unit outputUnit)
throws ConversionException
amounts - The numerical values in this unit.outputUnit - The unit to which to convert the numerical
values.
ConversionException - The units aren't compatible.
float[] convertTo(float[] input,
Unit outputUnit,
float[] output)
throws ConversionException
input - The numerical values in this unit.outputUnit - The unit to which to convert the numerical
values.output - The output numerical values. May be the same
array as the input values.
output.
ConversionException - The units aren't compatible.
double[] convertTo(double[] input,
Unit outputUnit,
double[] output)
throws ConversionException
input - The numerical values in this unit.outputUnit - The unit to which to convert the numerical
values.output - The output numerical values. May be the same
array as the input values.
output.
ConversionException - The units aren't compatible.boolean isCompatible(Unit that)
that - The other unit.
boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - The object.
true if and only if this unit
is semantically identical to the object.java.lang.String makeLabel(java.lang.String quantityID)
quantityID - An identifier of the quantity for which the
label is intended (e.g. "altitude").
boolean isDimensionless()
true if and only if this unit is
dimensionless.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||