Q
- The type of the quantity.public class DefaultQuantityFactory<Q extends javax.measure.Quantity<Q>> extends Object implements javax.measure.spi.QuantityFactory<Q>
Number
/ Unit
).
For example:
Mass m = DefaultQuantityFactory.getInstance(Mass.class).create(23.0, KILOGRAM); // 23.0 kg
Time m = DefaultQuantityFactory.getInstance(Time.class).create(124, MILLI(SECOND)); // 124 ms
Modifier and Type | Method and Description |
---|---|
javax.measure.Quantity<Q> |
create(Number value,
javax.measure.Unit<Q> unit) |
boolean |
equals(Object obj) |
static <Q extends javax.measure.Quantity<Q>> |
getInstance(Class<Q> type)
Returns the default instance for the specified quantity type.
|
javax.measure.Unit<Q> |
getSystemUnit() |
int |
hashCode() |
String |
toString() |
public static <Q extends javax.measure.Quantity<Q>> javax.measure.spi.QuantityFactory<Q> getInstance(Class<Q> type)
Q
- The type of the quantitytype
- the quantity typepublic javax.measure.Unit<Q> getSystemUnit()
Copyright © 2005-2017 Units of Measurement project. All Rights Reserved.