quantity objects.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static < The type of Quantity to be created. Q extends Quantity | Returns: The quantity instance,null if either the value param or unit param is null.The amount to be placed in the quantity instance. value, Unit<Q> The unit to represent the quantity. unit)Creates a new quantity instance using the given value and the given unit. |
| public static <Q extends Quantity | roundQuantity(Quantity<Q> value, Quantity<Q> precision)
Applies a rounding mechanism that returns the nearest value according to the precision. |
| public static < The quantity type. Q extends Quantity | Returns: A new quantity instance having the value truncated.The quantity to be truncated. value, Quantity<Q> The precision which the value is truncated to. precision)Truncates the given quantity value to the given precision, meaning that the value is floor rounded always. |
| QuantitiesUtil | back to summary |
|---|---|
| private QuantitiesUtil() | |
| createQuantity | back to summary |
|---|---|
| public static <Q extends Quantity Creates a new quantity instance using the given value and the given unit. | |
| roundQuantity | back to summary |
|---|---|
| public static <Q extends Quantity Applies a rounding mechanism that returns the nearest value according to the precision. Examples:
| |
| truncateQuantity | back to summary |
|---|---|
| public static <Q extends Quantity Truncates the given quantity value to the given precision, meaning that the value is floor rounded always. Examples:
| |