From df94066e3af02ff02d5ab4d033a3d603f743234c Mon Sep 17 00:00:00 2001 From: bjculkin Date: Mon, 12 Feb 2018 22:45:04 -0500 Subject: Formatting pass --- base/src/main/java/bjc/utils/data/IPair.java | 98 ++++++++++++---------------- 1 file changed, 43 insertions(+), 55 deletions(-) (limited to 'base/src/main/java/bjc/utils/data/IPair.java') diff --git a/base/src/main/java/bjc/utils/data/IPair.java b/base/src/main/java/bjc/utils/data/IPair.java index 75b092d..1c864d1 100644 --- a/base/src/main/java/bjc/utils/data/IPair.java +++ b/base/src/main/java/bjc/utils/data/IPair.java @@ -12,10 +12,10 @@ import bjc.utils.funcdata.theory.Bifunctor; * @author ben * * @param - * The type of the left side of the pair. + * The type of the left side of the pair. * * @param - * The type of the right side of the pair. + * The type of the right side of the pair. * */ public interface IPair extends Bifunctor { @@ -23,16 +23,15 @@ public interface IPair extends Bifunctor - * The type of the bound left. + * The type of the bound left. * * @param - * The type of the bound right. + * The type of the bound right. * * @param binder - * The function to bind with. + * The function to bind with. * - * @return - * The bound pair. + * @return The bound pair. */ public IPair bind( BiFunction> binder); @@ -41,13 +40,12 @@ public interface IPair extends Bifunctor - * The type of the bound value. + * The type of the bound value. * * @param leftBinder - * The function to use to bind. + * The function to use to bind. * - * @return - * A pair with the left type bound. + * @return A pair with the left type bound. */ public IPair bindLeft( Function> leftBinder); @@ -56,13 +54,12 @@ public interface IPair extends Bifunctor - * The type of the bound value. + * The type of the bound value. * * @param rightBinder - * The function to use to bind. + * The function to use to bind. * - * @return - * A pair with the right type bound. + * @return A pair with the right type bound. */ public IPair bindRight( Function> rightBinder); @@ -71,16 +68,15 @@ public interface IPair extends Bifunctor - * The left type of the other pair. + * The left type of the other pair. * * @param - * The right type of the other pair. + * The right type of the other pair. * * @param otherPair - * The pair to combine with. + * The pair to combine with. * - * @return - * The pairs, pairwise combined together. + * @return The pairs, pairwise combined together. */ public default IPair, IPair> combine( final IPair otherPair) { @@ -91,28 +87,27 @@ public interface IPair extends Bifunctor - * The type of the left value of the other pair. + * The type of the left value of the other pair. * * @param - * The type of the right value of the other pair. + * The type of the right value of the other pair. * * @param - * The type of the left value of the combined pair. + * The type of the left value of the combined pair. * * @param - * The type of the right value of the combined pair. + * The type of the right value of the combined pair. * * @param otherPair - * The other pair to combine with. + * The other pair to combine with. * * @param leftCombiner - * The function to combine the left values with. + * The function to combine the left values with. * * @param rightCombiner - * The function to combine the right values with. + * The function to combine the right values with. * - * @return - * A pair with its values combined. + * @return A pair with its values combined. */ public IPair combine( IPair otherPair, @@ -124,7 +119,7 @@ public interface IPair extends Bifunctor consumer) { merge((leftValue, rightValue) -> { @@ -135,10 +130,10 @@ public interface IPair extends Bifunctor LeftBifunctorMap - fmapLeft(final Function func) { + default LeftBifunctorMap fmapLeft( + final Function func) { return argumentPair -> { - if (!(argumentPair instanceof IPair)) { + if(!(argumentPair instanceof IPair)) { final String msg = "This function can only be applied to instances of IPair"; throw new IllegalArgumentException(msg); @@ -151,10 +146,10 @@ public interface IPair extends Bifunctor RightBifunctorMap - fmapRight(final Function func) { + default RightBifunctorMap fmapRight( + final Function func) { return argumentPair -> { - if (!(argumentPair instanceof IPair)) { + if(!(argumentPair instanceof IPair)) { final String msg = "This function can only be applied to instances of IPair"; throw new IllegalArgumentException(msg); @@ -169,8 +164,7 @@ public interface IPair extends Bifunctor extends Bifunctor extends Bifunctor - * The new type of the left part of the pair. + * The new type of the left part of the pair. * * @param mapper - * The function to use to transform the left part of the - * pair. + * The function to use to transform the left part of the pair. * - * @return - * The pair, with its left part transformed. + * @return The pair, with its left part transformed. */ public IPair mapLeft(Function mapper); @@ -211,14 +202,12 @@ public interface IPair extends Bifunctor - * The new type of the right part of the pair. + * The new type of the right part of the pair. * * @param mapper - * The function to use to transform the right part of the - * pair. + * The function to use to transform the right part of the pair. * - * @return - * The pair, with its right part transformed. + * @return The pair, with its right part transformed. */ public IPair mapRight(Function mapper); @@ -226,13 +215,12 @@ public interface IPair extends Bifunctor - * The type of the single value. + * The type of the single value. * * @param merger - * The function to use for merging. + * The function to use for merging. * - * @return - * The pair, merged into a single value. + * @return The pair, merged into a single value. */ public MergedType merge(BiFunction merger); } -- cgit v1.2.3