- 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>
public class InvertibleComposite<B,I> extends Object implements Invertible<B,I>
TheInvertibleComposite
implements theInvertible
and is composed of aBijectiveFunction
and the accordingInverseFunction
.
-
-
Constructor Summary
Constructors Constructor Description InvertibleComposite(BijectiveFunction<B,I> aBijectiveFunction, InverseFunction<I,B> aInverseFunction)
Constructs theInvertibleComposite
from the providedBijectiveFunction
and the accordingInverseFunction
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description B
applyBijection(I aValue)
Applies the bijective function to the given value.I
applyInversion(B aValue)
Applies the inverse function to the given value.
-
-
-
Constructor Detail
-
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 Detail
-
applyBijection
public B applyBijection(I aValue)
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
public I applyInversion(B aValue)
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.
-
-