Class IdentityConverter
java.lang.Object
org.episteme.core.measure.converters.IdentityConverter
- All Implemented Interfaces:
UnitConverter
The identity converter - performs no conversion.
This is used when converting between the same unit.
* @author Silvere Martin-Michiellot- Since:
- 1.0
- Author:
- Gemini AI (Google DeepMind)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionconcatenate(UnitConverter other) Returns a converter that first applies this converter, then the other.Converts a value from the source unit to the target unit.derivative(Real value) Returns the derivative of the conversion function at the given value.inverse()Returns the inverse of this converter.booleanChecks if this converter is an identity converter (no conversion).booleanisLinear()Checks if this converter is linear (scale only, no offset).toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface UnitConverter
convert
-
Field Details
-
INSTANCE
-
-
Method Details
-
convert
Description copied from interface:UnitConverterConverts a value from the source unit to the target unit.- Specified by:
convertin interfaceUnitConverter- Parameters:
value- the value to convert- Returns:
- the converted value
-
inverse
Description copied from interface:UnitConverterReturns the inverse of this converter.The inverse converter performs the reverse transformation.
- Specified by:
inversein interfaceUnitConverter- Returns:
- the inverse converter
-
concatenate
Description copied from interface:UnitConverterReturns a converter that first applies this converter, then the other.For example, if this converts meters to feet and
otherconverts feet to miles, the result converts meters to miles.- Specified by:
concatenatein interfaceUnitConverter- Parameters:
other- the converter to apply after this one- Returns:
- the concatenated converter
-
isIdentity
public boolean isIdentity()Description copied from interface:UnitConverterChecks if this converter is an identity converter (no conversion).- Specified by:
isIdentityin interfaceUnitConverter- Returns:
- true if this is the identity converter
-
isLinear
public boolean isLinear()Description copied from interface:UnitConverterChecks if this converter is linear (scale only, no offset).Linear converters satisfy: f(x + y) = f(x) + f(y) and f(ax) = aâ‹…f(x).
- Specified by:
isLinearin interfaceUnitConverter- Returns:
- true if this converter is linear
-
derivative
Description copied from interface:UnitConverterReturns the derivative of the conversion function at the given value.For linear converters, this is constant. For affine converters (like temperature), this is also constant.
- Specified by:
derivativein interfaceUnitConverter- Parameters:
value- the value at which to evaluate the derivative- Returns:
- the derivative (conversion rate)
-
toString
-