Top Description Fields Constructors Methods
tech.units.indriya.internal.function.simplify

public Class UnitCompositionHandlerYieldingNormalForm

extends Object
implements ConverterCompositionHandler
Class Inheritance
All Implemented Interfaces
tech.units.indriya.function.ConverterCompositionHandler
Imports
java.util.Map, .Objects, java.util.function.BiPredicate, .BinaryOperator, tech.units.indriya.function.AbstractConverter, .Calculus, .ConverterCompositionHandler, .PowerOfIntConverter

UnitCompositionHandler yielding a normal-form. A normal-form is required to decide whether two UnitConverters are equivalent.
Author
Andi Huber
Since
2.0
Version
1.1

Field Summary

Modifier and TypeField and Description
private final Map<Class<? extends AbstractConverter>, Integer>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public AbstractConverter
compose(AbstractConverter a, AbstractConverter b, BiPredicate<AbstractConverter, AbstractConverter> canReduce, BinaryOperator<AbstractConverter> doReduce)

Implements tech.units.indriya.function.ConverterCompositionHandler.compose.

Takes two converters left, right and returns a (not necessarily new) converter that is equivalent to the mathematical composition of these:

compose(left, right) === left o right

Implementation Note: Instead of using AbstractConverter as parameter and result types, this could be generalized to UnitConverter, but that would require some careful changes within AbstractConverter itself.

private boolean
private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

normalFormOrderback to summary
private final Map<Class<? extends AbstractConverter>, Integer> normalFormOrder

Constructor Detail

UnitCompositionHandlerYieldingNormalFormback to summary
public UnitCompositionHandlerYieldingNormalForm()

Method Detail

composeback to summary
public AbstractConverter compose(AbstractConverter a, AbstractConverter b, BiPredicate<AbstractConverter, AbstractConverter> canReduce, BinaryOperator<AbstractConverter> doReduce)

Implements tech.units.indriya.function.ConverterCompositionHandler.compose.

Doc from tech.units.indriya.function.ConverterCompositionHandler.compose.

Takes two converters left, right and returns a (not necessarily new) converter that is equivalent to the mathematical composition of these:

compose(left, right) === left o right

Implementation Note: Instead of using AbstractConverter as parameter and result types, this could be generalized to UnitConverter, but that would require some careful changes within AbstractConverter itself.

Annotations
@Override
isNormalFormOrderWhenCommutativeback to summary
private boolean isNormalFormOrderWhenCommutative(AbstractConverter a, AbstractConverter b)
isNormalFormOrderWhenIdentityback to summary
private boolean isNormalFormOrderWhenIdentity(AbstractConverter a, AbstractConverter b)