javax.measure.converter
Class LinearConverter

java.lang.Object
  extended by javax.measure.converter.UnitConverter
      extended by javax.measure.converter.LinearConverter
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MultiplyConverter, RationalConverter

public abstract class LinearConverter
extends UnitConverter

This class represents a linear converter. A converter is linear if convert(u + v) == convert(u) + convert(v) and convert(r * u) == r * convert(u). For linear converters the following property always hold:

     y1 = c1.convert(x1); 
     y2 = c2.convert(x2); 
     // then y1*y2 == c1.concatenate(c2).convert(x1*x2)
 

Concatenation of linear converters always result into a linear converter.

Version:
1.0, April 15, 2009
Author:
Jean-Marie Dautelle
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.measure.converter.UnitConverter
IDENTITY
 
Constructor Summary
LinearConverter()
           
 
Method Summary
 UnitConverter concatenate(UnitConverter converter)
          Concatenates this converter with another converter.
abstract  LinearConverter inverse()
          Returns the inverse of this converter.
 
Methods inherited from class javax.measure.converter.UnitConverter
convert, convert, equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearConverter

public LinearConverter()
Method Detail

concatenate

public UnitConverter concatenate(UnitConverter converter)
Description copied from class: UnitConverter
Concatenates this converter with another converter. The resulting converter is equivalent to first converting by the specified converter, and then converting by this converter.

Note: Implementations must ensure that the UnitConverter.IDENTITY instance is returned if the resulting converter is an identity converter.

Overrides:
concatenate in class UnitConverter
Parameters:
converter - the other converter.
Returns:
the concatenation of this converter with the other converter.

inverse

public abstract LinearConverter inverse()
Description copied from class: UnitConverter
Returns the inverse of this converter. If x is a valid value, then x == inverse().convert(convert(x)) to within the accuracy of computer arithmetic.

Specified by:
inverse in class UnitConverter
Returns:
the inverse of this converter.


Copyright © 2009 JScience. All Rights Reserved.