Package net.solarnetwork.javax.measure
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 Summary
ConstructorsConstructorDescriptionDelegateMeasurementServiceProvider(javax.measure.spi.ServiceProvider delegate) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionjavax.measure.spi.FormatServiceReturns the service to obtainUnitFormatandQuantityFormatornullif none.<Q extends javax.measure.Quantity<Q>>
javax.measure.spi.QuantityFactory<Q>getQuantityFactory(Class<Q> quantity) Returns a factory for the givenQuantitytype.javax.measure.spi.SystemOfUnitsServiceReturns the service to obtain aSystemOfUnits, ornullif none.javax.measure.spi.UnitFormatServiceReturns the service to obtain aUnitFormat, ornullif none.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.javax.measure.MeasurementServiceProvider
quantityForUnit
-
Constructor Details
-
DelegateMeasurementServiceProvider
public DelegateMeasurementServiceProvider(javax.measure.spi.ServiceProvider delegate) Constructor.- Parameters:
delegate- the delegate- Throws:
IllegalArgumentException- ifdelegateis null
-
-
Method Details
-
getSystemOfUnitsService
public javax.measure.spi.SystemOfUnitsService getSystemOfUnitsService()Description copied from interface:MeasurementServiceProviderReturns the service to obtain aSystemOfUnits, ornullif none.- Specified by:
getSystemOfUnitsServicein interfaceMeasurementServiceProvider- Returns:
- the service to obtain a
SystemOfUnits, ornull.
-
getFormatService
public javax.measure.spi.FormatService getFormatService()Description copied from interface:MeasurementServiceProviderReturns the service to obtainUnitFormatandQuantityFormatornullif none.- Specified by:
getFormatServicein interfaceMeasurementServiceProvider- Returns:
- the service to obtain a
UnitFormatandQuantityFormat, ornull.
-
getUnitFormatService
public javax.measure.spi.UnitFormatService getUnitFormatService()Description copied from interface:MeasurementServiceProviderReturns the service to obtain aUnitFormat, ornullif none.This API is deprecated in
javax.measure2.0, but the reference implementation exposes some parsing features only through this API (UCUM) so it is repeated here.- Specified by:
getUnitFormatServicein interfaceMeasurementServiceProvider- Returns:
- the service to obtain a
UnitFormat, ornull.
-
getQuantityFactory
public <Q extends javax.measure.Quantity<Q>> javax.measure.spi.QuantityFactory<Q> getQuantityFactory(Class<Q> quantity) Description copied from interface:MeasurementServiceProviderReturns a factory for the givenQuantitytype.- Specified by:
getQuantityFactoryin interfaceMeasurementServiceProvider- Type Parameters:
Q- the type of theQuantityinstances created by the factory- Parameters:
quantity- the quantity type- Returns:
- the
QuantityFactoryfor the given type
-