From c82e3b3b2de0633317ec8fc85925e91422820597 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Sun, 8 Oct 2017 22:39:59 -0300 Subject: Start splitting into maven modules --- .../main/java/bjc/utils/funcutils/Isomorphism.java | 60 ---------------------- 1 file changed, 60 deletions(-) delete mode 100644 BJC-Utils2/src/main/java/bjc/utils/funcutils/Isomorphism.java (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/Isomorphism.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcutils/Isomorphism.java b/BJC-Utils2/src/main/java/bjc/utils/funcutils/Isomorphism.java deleted file mode 100644 index 2d3655e..0000000 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/Isomorphism.java +++ /dev/null @@ -1,60 +0,0 @@ -package bjc.utils.funcutils; - -import java.util.function.Function; - -/** - * A pair of functions to transform between a pair of types. - * - * @author bjculkin - * - * @param - * The source type of the isomorphism. - * - * @param - * The destination type of isomorphism. - * - */ -public class Isomorphism { - private Function toFunc; - private Function fromFunc; - - /** - * Create a new isomorphism. - * - * @param to - * The 'forward' function, from the source to the - * definition. - * - * @param from - * The 'backward' function, from the definition to the - * source. - */ - public Isomorphism(Function to, Function from) { - toFunc = to; - fromFunc = from; - } - - /** - * Apply the isomorphism forward. - * - * @param val - * The source value. - * - * @return The destination value. - */ - public D to(S val) { - return toFunc.apply(val); - } - - /** - * Apply the isomorphism backward. - * - * @param val - * The destination value. - * - * @return The source value. - */ - public S from(D val) { - return fromFunc.apply(val); - } -} -- cgit v1.2.3