Package javax.measure.test.function
Class MultiplyConverter
Object
TestConverter
MultiplyConverter
- All Implemented Interfaces:
Comparable<UnitConverter>
,UnitConverter
This class represents a converter multiplying numeric values by a constant scaling factor (double
based).
- Since:
- 2.0
- Version:
- 1.1, June 28, 2019
- Author:
- Jean-Marie Dautelle, Werner Keil
-
Nested Class Summary
Nested classes/interfaces inherited from class TestConverter
TestConverter.Pair
-
Field Summary
Fields inherited from class TestConverter
IDENTITY
-
Constructor Summary
ConstructorDescriptionMultiplyConverter
(double factor) Creates a multiply converter with the specified scale factor.MultiplyConverter
(Number factor) Creates a multiply converter with the specified scale factor. -
Method Summary
Modifier and TypeMethodDescriptionint
concatenate
(UnitConverter converter) double
convert
(double value) boolean
double
Returns the scale factor of this converter.getValue()
int
hashCode()
inverse()
boolean
isLinear()
final String
toString()
Methods inherited from class TestConverter
concatenate, convert, getConversionSteps, isIdentity
-
Constructor Details
-
MultiplyConverter
Creates a multiply converter with the specified scale factor.- Parameters:
factor
- the scaling factor.- Throws:
IllegalArgumentException
- if coefficient is1.0
(would result in identity converter)
-
MultiplyConverter
Creates a multiply converter with the specified scale factor.- Parameters:
factor
- the scaling factor.- Throws:
IllegalArgumentException
- if coefficient is1.0
(would result in identity converter)
-
-
Method Details
-
getFactor
Returns the scale factor of this converter.- Returns:
- the scale factor.
-
concatenate
- Specified by:
concatenate
in interfaceUnitConverter
- Overrides:
concatenate
in classTestConverter
-
inverse
- Specified by:
inverse
in interfaceUnitConverter
- Specified by:
inverse
in classTestConverter
-
convert
- Specified by:
convert
in interfaceUnitConverter
- Specified by:
convert
in classTestConverter
-
toString
-
equals
- Specified by:
equals
in classTestConverter
-
hashCode
- Specified by:
hashCode
in classTestConverter
-
isLinear
- Specified by:
isLinear
in interfaceUnitConverter
-
getValue
-
compareTo
- Specified by:
compareTo
in interfaceComparable<UnitConverter>
-