java.lang.Object
org.refcodes.numerical.InvertibleComposite<B,I>
- Type Parameters:
B
- The type of the bijective function's result (being the inverse function's input type).I
- The type of the inverse function's result (being the bijective function's input type).
- All Implemented Interfaces:
BijectiveFunction<B,
,I> InverseFunction<I,
,B> Invertible<B,
I>
The
InvertibleComposite
implements the Invertible
and is
composed of a BijectiveFunction
and the according
InverseFunction
.-
Constructor Summary
ConstructorDescriptionInvertibleComposite
(BijectiveFunction<B, I> aBijectiveFunction, InverseFunction<I, B> aInverseFunction) Constructs theInvertibleComposite
from the providedBijectiveFunction
and the accordingInverseFunction
. -
Method Summary
Modifier and TypeMethodDescriptionapplyBijection
(I aValue) Applies the bijective function to the given value.applyInversion
(B aValue) Applies the inverse function to the given value.
-
Constructor Details
-
InvertibleComposite
public InvertibleComposite(BijectiveFunction<B, I> aBijectiveFunction, InverseFunction<I, B> aInverseFunction) Constructs theInvertibleComposite
from the providedBijectiveFunction
and the accordingInverseFunction
.- Parameters:
aBijectiveFunction
- TheBijectiveFunction
responsible for theapplyBijection(Object)
operation.aInverseFunction
- TheInverseFunction
responsible for theapplyInversion(Object)
operation.
-
-
Method Details
-
applyBijection
Applies the bijective function to the given value.- Specified by:
applyBijection
in interfaceBijectiveFunction<B,
I> - Parameters:
aValue
- The (invertion's) value.- Returns:
- The according bijection.
-
applyInversion
Applies the inverse function to the given value.- Specified by:
applyInversion
in interfaceInverseFunction<B,
I> - Parameters:
aValue
- The (bijection's) value.- Returns:
- The according inversion.
-