Class ProxyQuantityFactory.Default<Q extends javax.measure.Quantity<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 every AbstractMeasurement 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.
    • Constructor Summary

      Constructors 
      Constructor Description
      Default​(java.lang.Class<Q> type)
      Creates a new factory for quantities of the given type.
    • 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 or null if unknown.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 or null if unknown.
        Specified by:
        getSystemUnit in interface javax.measure.spi.QuantityFactory<Q extends javax.measure.Quantity<Q>>
        Specified by:
        getSystemUnit in class ProxyQuantityFactory<Q extends javax.measure.Quantity<Q>>
        Returns:
        the metric units for this factory quantities.
      • create

        public javax.measure.Quantity<Q> create​(java.lang.Number value,
                                                javax.measure.Unit<Q> unit)