diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-11 22:49:16 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-11 22:49:16 -0300 |
| commit | 8923edffdb36b790014ff47301e53f7ede93ea0d (patch) | |
| tree | e1cff9168eb79110a8832249d208f2978f549a04 /base/src/main/java/bjc/utils/funcutils/Isomorphism.java | |
| parent | 946cab444bc301d8a7c756a1bab039558288de89 (diff) | |
Cleanup more
Diffstat (limited to 'base/src/main/java/bjc/utils/funcutils/Isomorphism.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/funcutils/Isomorphism.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/base/src/main/java/bjc/utils/funcutils/Isomorphism.java b/base/src/main/java/bjc/utils/funcutils/Isomorphism.java index 2d3655e..d86ee9f 100644 --- a/base/src/main/java/bjc/utils/funcutils/Isomorphism.java +++ b/base/src/main/java/bjc/utils/funcutils/Isomorphism.java @@ -8,26 +8,25 @@ import java.util.function.Function; * @author bjculkin * * @param <S> - * The source type of the isomorphism. + * The source type of the isomorphism. * * @param <D> - * The destination type of isomorphism. - * + * The destination type of isomorphism. */ public class Isomorphism<S, D> { + /* The function to the destination type. */ private Function<S, D> toFunc; + /* The function to the source type. */ private Function<D, S> fromFunc; /** * Create a new isomorphism. * * @param to - * The 'forward' function, from the source to the - * definition. + * The 'forward' function, from the source to the definition. * * @param from - * The 'backward' function, from the definition to the - * source. + * The 'backward' function, from the definition to the source. */ public Isomorphism(Function<S, D> to, Function<D, S> from) { toFunc = to; @@ -38,9 +37,10 @@ public class Isomorphism<S, D> { * Apply the isomorphism forward. * * @param val - * The source value. + * The source value. * - * @return The destination value. + * @return + * The destination value. */ public D to(S val) { return toFunc.apply(val); @@ -50,9 +50,10 @@ public class Isomorphism<S, D> { * Apply the isomorphism backward. * * @param val - * The destination value. + * The destination value. * - * @return The source value. + * @return + * The source value. */ public S from(D val) { return fromFunc.apply(val); |
