Q - The type of the quantity.public final class DefaultQuantityFactory<Q extends javax.measure.Quantity<Q>> extends Object
AbstractQuantity sub-type.
For example:
Quantity m = DefaultQuantityFactory.getInstance(Mass.class).create(23.0, KILOGRAM); // 23.0 kg
Quantity | Modifier and Type | Method and Description |
|---|---|
javax.measure.Quantity<Q> |
create(Number value,
javax.measure.Unit<Q> unit)
Returns the quantity for the specified number stated in the specified unit.
|
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() |
protected static <Q extends javax.measure.Quantity<Q>> |
setInstance(Class<Q> type,
tec.units.ri.quantity.AbstractQuantityFactory<Q> factory)
Overrides the default implementation of the factory for the specified quantity type.
|
public javax.measure.Quantity<Q> create(Number value, javax.measure.Unit<Q> unit)
public javax.measure.Unit<Q> getSystemUnit()
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 typeprotected static <Q extends javax.measure.Quantity<Q>> void setInstance(Class<Q> type, tec.units.ri.quantity.AbstractQuantityFactory<Q> factory)
Q - The type of the quantitytype - the quantity typefactory - the quantity factoryCopyright © 2005–2016 Jean-Marie Dautelle, Werner Keil, V2COM. All rights reserved.