Class DelegateMeasurementServiceProvider

java.lang.Object
net.solarnetwork.javax.measure.DelegateMeasurementServiceProvider
All Implemented Interfaces:
MeasurementServiceProvider
Direct Known Subclasses:
IndriyaMeasurementServiceProvider

public abstract class DelegateMeasurementServiceProvider extends Object implements MeasurementServiceProvider
Implementation of MeasurementServiceProvider that delgates to a ServiceProvider.
Version:
1.0
Author:
matt
  • Constructor Details

    • DelegateMeasurementServiceProvider

      public DelegateMeasurementServiceProvider(javax.measure.spi.ServiceProvider delegate)
      Constructor.
      Parameters:
      delegate - the delegate
      Throws:
      IllegalArgumentException - if delegate is null
  • Method Details

    • getSystemOfUnitsService

      public javax.measure.spi.SystemOfUnitsService getSystemOfUnitsService()
      Description copied from interface: MeasurementServiceProvider
      Returns the service to obtain a SystemOfUnits, or null if none.
      Specified by:
      getSystemOfUnitsService in interface MeasurementServiceProvider
      Returns:
      the service to obtain a SystemOfUnits, or null.
    • getFormatService

      public javax.measure.spi.FormatService getFormatService()
      Description copied from interface: MeasurementServiceProvider
      Returns the service to obtain UnitFormat and QuantityFormat or null if none.
      Specified by:
      getFormatService in interface MeasurementServiceProvider
      Returns:
      the service to obtain a UnitFormat and QuantityFormat, or null.
    • getUnitFormatService

      public javax.measure.spi.UnitFormatService getUnitFormatService()
      Description copied from interface: MeasurementServiceProvider
      Returns the service to obtain a UnitFormat, or null if none.

      This API is deprecated in javax.measure 2.0, but the reference implementation exposes some parsing features only through this API (UCUM) so it is repeated here.

      Specified by:
      getUnitFormatService in interface MeasurementServiceProvider
      Returns:
      the service to obtain a UnitFormat, or null.
    • getQuantityFactory

      public <Q extends javax.measure.Quantity<Q>> javax.measure.spi.QuantityFactory<Q> getQuantityFactory(Class<Q> quantity)
      Description copied from interface: MeasurementServiceProvider
      Returns a factory for the given Quantity type.
      Specified by:
      getQuantityFactory in interface MeasurementServiceProvider
      Type Parameters:
      Q - the type of the Quantity instances created by the factory
      Parameters:
      quantity - the quantity type
      Returns:
      the QuantityFactory for the given type