Class SimpleConverterBase<S extends javax.measure.Quantity<S>,T extends javax.measure.Quantity<T>>

java.lang.Object
gda.util.converters.SimpleConverterBase<S,T>
All Implemented Interfaces:
IConverter<javax.measure.Quantity<S>,javax.measure.Quantity<T>>
Direct Known Subclasses:
SimpleConverter

public abstract class SimpleConverterBase<S extends javax.measure.Quantity<S>,T extends javax.measure.Quantity<T>> extends Object implements IConverter<javax.measure.Quantity<S>,javax.measure.Quantity<T>>
Base class for 'simple' converters that implement the IConverter interface, converting from one Quantity to another Quantity, using an object that implements the IReloadableQuantitiesConverter interface.
  • Field Details

  • Constructor Details

    • SimpleConverterBase

      public SimpleConverterBase()
  • Method Details

    • toTarget

      public javax.measure.Quantity<T> toTarget(javax.measure.Quantity<S> source) throws Exception
      Description copied from interface: IConverter
      Calculates a value for Target given the value of the source
      Specified by:
      toTarget in interface IConverter<S extends javax.measure.Quantity<S>,T extends javax.measure.Quantity<T>>
      Parameters:
      source -
      Returns:
      The value calculated from the value of the source
      Throws:
      Exception
    • toSource

      public javax.measure.Quantity<S> toSource(javax.measure.Quantity<T> target) throws Exception
      Description copied from interface: IConverter
      Calculates a value for Source given the value of the target
      Specified by:
      toSource in interface IConverter<S extends javax.measure.Quantity<S>,T extends javax.measure.Quantity<T>>
      Parameters:
      target -
      Returns:
      The value calculated from the value of the target *
      Throws:
      Exception
    • sourceMinIsTargetMax

      public boolean sourceMinIsTargetMax()
      Description copied from interface: IConverter
      Returns true is the conversion reverses the sense. So that to get the max of the source you convert the min of the target and vice versa
      Specified by:
      sourceMinIsTargetMax in interface IConverter<S extends javax.measure.Quantity<S>,T extends javax.measure.Quantity<T>>
      Returns:
      true is the conversion reverses the sense.
    • getConverter

      public IReloadableQuantitiesConverter<S,T> getConverter()