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
ConstructorsConstructorDescriptionInvertibleComposite(BijectiveFunction<B, I> aBijectiveFunction, InverseFunction<I, B> aInverseFunction) Constructs theInvertibleCompositefrom the providedBijectiveFunctionand 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 theInvertibleCompositefrom the providedBijectiveFunctionand the accordingInverseFunction.- Parameters:
aBijectiveFunction- TheBijectiveFunctionresponsible for theapplyBijection(Object)operation.aInverseFunction- TheInverseFunctionresponsible for theapplyInversion(Object)operation.
-
-
Method Details
-
applyBijection
Applies the bijective function to the given value.- Specified by:
applyBijectionin interfaceBijectiveFunction<B,I> - Parameters:
aValue- The (invertion's) value.- Returns:
- The according bijection.
-
applyInversion
Applies the inverse function to the given value.- Specified by:
applyInversionin interfaceInverseFunction<B,I> - Parameters:
aValue- The (bijection's) value.- Returns:
- The according inversion.
-