public class Measure extends Object implements Serializable
| Constructor and Description |
|---|
Measure(double value,
Unit unit)
Creates a new Measure.
|
Measure(Number value,
Unit unit)
Creates a new Measure.
|
Measure(Number value,
Unit unit,
double precision)
Creates a new Measure.
|
| Modifier and Type | Method and Description |
|---|---|
Measure |
convert(Unit unit)
Converts this measure to another unit.
|
Unit |
getCompatibleUnit(Unit... units)
Get compatible Unit for this unit It uses after WKT parsing.
|
double |
getPrecision()
Gets the precision of this measure.
|
Quantity |
getQuantity()
Gets the Quantity measured.
|
double |
getSValue()
Gets the value of this measure expressed as a double in the base unit.
|
Unit |
getUnit()
Gets the unit of this measure.
|
Number |
getValue()
Gets the value of this measure.
|
void |
setUnit(Unit unit)
Set the unit of this measure.
|
void |
setValue(Number value)
Set Value of this measure.
|
Measure |
toBaseUnit()
Gets the same Measure using the base unit.
|
String |
toString()
Returns the measure as a String.
|
public Measure(double value,
Unit unit)
value - the value of the measureunit - the unit used to express the measurepublic Measure(Number value, Unit unit)
value - the value of the measureunit - the unit used to express the measurepublic Measure(Number value, Unit unit, double precision)
value - the value of the measureunit - the unit used to express the measureprecision - of this measure. If different from NaN, this parameter
can be used to express a limit in this measure precision for future
calculations.public double getSValue()
public Number getValue()
public void setValue(Number value)
value - the new Value to set to this Measurepublic Unit getUnit()
public void setUnit(Unit unit)
unit - the new Unit to set to this Measurepublic Quantity getQuantity()
public double getPrecision()
public Measure toBaseUnit()
public Measure convert(Unit unit) throws IllegalArgumentException
unit - the new unit for the returned measureIllegalArgumentExceptionpublic String toString()
Copyright © 2019 CNRS. All rights reserved.