Java Units API
Build 2004-02-06

javax.units
Class MultiplyConverter

Object
  extended byConverter
      extended byMultiplyConverter
All Implemented Interfaces:
Serializable

public final class MultiplyConverter
extends Converter

This class represents a multiply converter. A multiply converter multiplies numeric values by a constant scale factor.

Instances of this class are immutable.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class Converter
IDENTITY
 
Constructor Summary
MultiplyConverter(double factor)
          Creates a multiply converter with the specified scale factor.
 
Method Summary
 Converter concatenate(Converter converter)
          Concatenates this converter with another converter.
 double convert(double amount)
          Converts a double value.
 double derivative(double x)
          Returns this converter derivative for the specified x value.
 Converter inverse()
          Returns the inverse of this converter.
 boolean isLinear()
          Indicates if this converter is linear.
 
Methods inherited from class Converter
equals, hashCode
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiplyConverter

public MultiplyConverter(double factor)
Creates a multiply converter with the specified scale factor.

Parameters:
factor - the scale factor.
Method Detail

inverse

public Converter inverse()
Description copied from class: Converter
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 Converter
Returns:
the inverse of this converter.

convert

public double convert(double amount)
Description copied from class: Converter
Converts a double value.

Specified by:
convert in class Converter
Parameters:
amount - the numeric value to convert.
Returns:
the converted numeric value.

derivative

public double derivative(double x)
Description copied from class: Converter
Returns this converter derivative for the specified x value. For linear converters, this method returns a constant (the linear factor) for all x values.

Specified by:
derivative in class Converter
Parameters:
x - the value for which the derivative is calculated.
Returns:
the derivative for the specified value.

isLinear

public boolean isLinear()
Description copied from class: Converter
Indicates if this converter is linear. A converter is linear if convert(u + v) == convert(u) + convert(v) and convert(r * u) == r * convert(u).

Specified by:
isLinear in class Converter
Returns:
true if this converter is linear; false otherwise.

concatenate

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

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

Java Units API
Build 2004-02-06

Symbols, terms and definitions
JSR-108 project