Q
- The type of the quantity.public abstract class ProxyQuantityFactory<Q extends javax.measure.Quantity<Q>> extends Object implements javax.measure.spi.QuantityFactory<Q>
Number
/Unit
).
For example:
Quantity m = ProxyQuantityFactory.getInstance(Mass.class).create(23.0, KILOGRAM); // 23.0 kg
Quantity
Constructor and Description |
---|
ProxyQuantityFactory() |
Modifier and Type | Method and Description |
---|---|
static <Q extends javax.measure.Quantity<Q>> |
getInstance(Class<Q> type)
Returns the default instance for the specified quantity type.
|
abstract javax.measure.Unit<Q> |
getSystemUnit()
Returns the metric unit for quantities produced by this factory or
null if unknown. |
protected static <Q extends javax.measure.Quantity<Q>> |
setInstance(Class<Q> type,
ProxyQuantityFactory<Q> factory)
Overrides the default implementation of the factory for the specified quantity type.
|
public ProxyQuantityFactory()
public static <Q extends javax.measure.Quantity<Q>> ProxyQuantityFactory<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, ProxyQuantityFactory<Q> factory)
Q
- The type of the quantitytype
- the quantity typefactory
- the quantity factorypublic abstract javax.measure.Unit<Q> getSystemUnit()
null
if unknown.Copyright © 2005-2017 Units of Measurement project. All Rights Reserved.