public abstract class ScalableQuantity<N extends Number> extends Quantity<N>
Constructor and Description |
---|
ScalableQuantity(N number,
int basePower,
String unit)
Creates a new scalable quantity with the specified base power.
|
ScalableQuantity(N number,
String unit)
Creates a new scalable quantity.
|
Modifier and Type | Method and Description |
---|---|
String |
toString() |
public ScalableQuantity(N number, String unit)
number
- The value.unit
- The unit of the value.public ScalableQuantity(N number, int basePower, String unit)
Creates a new scalable quantity with the specified base power.
For example in case of decimal numbers, when we want to insert 123 ms, we don't have to re-compute the value to the base unit power
(and pass it as 0.123 s
. With the base power we can pass the number value as is 123
and pass it with
the base power of -1
.
number
- The value.basePower
- The base power of the value.unit
- The unit of the value.Copyright © 2010–2017 PerfCake Community. All rights reserved.