From 504ca816530efdff06bc202e0432ebd354aec304 Mon Sep 17 00:00:00 2001 From: EVE Date: Tue, 14 Mar 2017 12:07:14 -0400 Subject: Cleanup --- BJC-Utils2/src/main/java/bjc/utils/data/IPair.java | 40 ++++++++++------------ 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/IPair.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/IPair.java b/BJC-Utils2/src/main/java/bjc/utils/data/IPair.java index 1405d75..24e0381 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/IPair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/IPair.java @@ -1,14 +1,14 @@ package bjc.utils.data; +import bjc.utils.funcdata.theory.Bifunctor; + import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; -import bjc.utils.funcdata.theory.Bifunctor; - /** * Represents a pair of values - * + * * @author ben * @param * The type of the left side of the pair @@ -19,7 +19,7 @@ import bjc.utils.funcdata.theory.Bifunctor; public interface IPair extends Bifunctor { /** * Bind a function across the values in this pair - * + * * @param * The type of the bound left * @param @@ -33,7 +33,7 @@ public interface IPair extends Bifunctor * The type of the bound value * @param leftBinder @@ -45,7 +45,7 @@ public interface IPair extends Bifunctor * The type of the bound value * @param rightBinder @@ -57,7 +57,7 @@ public interface IPair extends Bifunctor * The left type of the other pair * @param @@ -74,7 +74,7 @@ public interface IPair extends Bifunctor * The type of the left value of the other pair * @param @@ -97,7 +97,7 @@ public interface IPair extends Bifunctor extends Bifunctor Function, Bifunctor> fmapLeft( Function func) { return (argumentPair) -> { - if (!(argumentPair instanceof IPair)) { - throw new IllegalArgumentException( - "This function can only be applied to instances of IPair"); - } + if(!(argumentPair instanceof IPair)) throw new IllegalArgumentException( + "This function can only be applied to instances of IPair"); IPair argPair = (IPair) argumentPair; @@ -129,10 +127,8 @@ public interface IPair extends Bifunctor func) { return (argumentPair) -> { - if (!(argumentPair instanceof IPair)) { - throw new IllegalArgumentException( - "This function can only be applied to instances of IPair"); - } + if(!(argumentPair instanceof IPair)) throw new IllegalArgumentException( + "This function can only be applied to instances of IPair"); IPair argPair = (IPair) argumentPair; @@ -142,7 +138,7 @@ public interface IPair extends Bifunctor extends Bifunctor extends Bifunctor * The new type of the left part of the pair * @param mapper @@ -176,7 +172,7 @@ public interface IPair extends Bifunctor * The new type of the right part of the pair * @param mapper @@ -188,7 +184,7 @@ public interface IPair extends Bifunctor * The type of the single value * @param merger -- cgit v1.2.3