Package tech.units.indriya.quantity
Class ProxyQuantityFactory.Default<Q extends javax.measure.Quantity<Q>>
- java.lang.Object
-
- tech.units.indriya.quantity.ProxyQuantityFactory<Q>
-
- tech.units.indriya.quantity.ProxyQuantityFactory.Default<Q>
-
- Type Parameters:
Q
- The type of the quantity
- All Implemented Interfaces:
javax.measure.spi.QuantityFactory<Q>
- Enclosing class:
- ProxyQuantityFactory<Q extends javax.measure.Quantity<Q>>
private static final class ProxyQuantityFactory.Default<Q extends javax.measure.Quantity<Q>> extends ProxyQuantityFactory<Q>
The default factory implementation. This factory uses reflection for providing a default implementation for everyAbstractMeasurement
sub-types.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.util.HashMap<java.lang.Class,javax.measure.Unit>
CLASS_TO_METRIC_UNIT
private javax.measure.Unit<Q>
metricUnit
The metric unit for quantities created by this factory.private java.lang.Class<Q>
type
The type of the quantities created by this factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.measure.Quantity<Q>
create(java.lang.Number value, javax.measure.Unit<Q> unit)
javax.measure.Unit<Q>
getSystemUnit()
Returns the metric unit for quantities produced by this factory ornull
if unknown.-
Methods inherited from class tech.units.indriya.quantity.ProxyQuantityFactory
getInstance, setInstance
-
-
-
-
Field Detail
-
type
private final java.lang.Class<Q extends javax.measure.Quantity<Q>> type
The type of the quantities created by this factory.
-
metricUnit
private final javax.measure.Unit<Q extends javax.measure.Quantity<Q>> metricUnit
The metric unit for quantities created by this factory.
-
CLASS_TO_METRIC_UNIT
static final java.util.HashMap<java.lang.Class,javax.measure.Unit> CLASS_TO_METRIC_UNIT
-
-
Constructor Detail
-
Default
Default(java.lang.Class<Q> type)
Creates a new factory for quantities of the given type.- Parameters:
type
- The type of the quantities created by this factory.
-
-
Method Detail
-
getSystemUnit
public javax.measure.Unit<Q> getSystemUnit()
Description copied from class:ProxyQuantityFactory
Returns the metric unit for quantities produced by this factory ornull
if unknown.- Specified by:
getSystemUnit
in interfacejavax.measure.spi.QuantityFactory<Q extends javax.measure.Quantity<Q>>
- Specified by:
getSystemUnit
in classProxyQuantityFactory<Q extends javax.measure.Quantity<Q>>
- Returns:
- the metric units for this factory quantities.
-
-