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
ConstructorsConstructorDescriptionMultiplyConverter(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 TypeMethodDescriptionintconcatenate(UnitConverter converter) doubleconvert(double value) booleandoubleReturns the scale factor of this converter.getValue()inthashCode()inverse()booleanisLinear()final StringtoString()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:
concatenatein interfaceUnitConverter- Overrides:
concatenatein classTestConverter
-
inverse
- Specified by:
inversein interfaceUnitConverter- Specified by:
inversein classTestConverter
-
convert
- Specified by:
convertin interfaceUnitConverter- Specified by:
convertin classTestConverter
-
toString
-
equals
- Specified by:
equalsin classTestConverter
-
hashCode
- Specified by:
hashCodein classTestConverter
-
isLinear
- Specified by:
isLinearin interfaceUnitConverter
-
getValue
-
compareTo
- Specified by:
compareToin interfaceComparable<UnitConverter>
-