From 42f7d379a430aaf2fad169f0170de04072b08b10 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Fri, 22 Apr 2016 14:48:04 -0400 Subject: Formatting changes --- BJC-Utils2/src/main/java/bjc/utils/data/IPair.java | 64 +++++++++++----------- 1 file changed, 32 insertions(+), 32 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 ce38d60..316074e 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/IPair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/IPair.java @@ -15,6 +15,20 @@ import java.util.function.Function; * */ public interface IPair { + /** + * Bind a function across the values in this pair + * + * @param + * The type of the bound left + * @param + * The type of the bound right + * @param binder + * The function to bind with + * @return The bound pair + */ + public IPair bind( + BiFunction> binder); + /** * Bind a function to the left value in this pair * @@ -40,30 +54,19 @@ public interface IPair { Function> rightBinder); /** - * Bind a function across the values in this pair + * Immediately perfom the specified action with the contents of this + * pair * - * @param - * The type of the bound left - * @param - * The type of the bound right - * @param binder - * The function to bind with - * @return The bound pair + * @param consumer + * The action to perform on the pair */ - public IPair bind( - BiFunction> binder); + public default void doWith(BiConsumer consumer) { + merge((leftValue, rightValue) -> { + consumer.accept(leftValue, rightValue); - /** - * Merge the two values in this pair into a single value - * - * @param - * The type of the single value - * @param merger - * The function to use for merging - * @return The pair, merged into a single value - */ - public MergedType merge( - BiFunction merger); + return null; + }); + } /** * Get the value on the left side of the pair @@ -84,17 +87,14 @@ public interface IPair { } /** - * Immediately perfom the specified action with the contents of this - * pair + * Merge the two values in this pair into a single value * - * @param consumer - * The action to perform on the pair + * @param + * The type of the single value + * @param merger + * The function to use for merging + * @return The pair, merged into a single value */ - public default void doWith(BiConsumer consumer) { - merge((leftValue, rightValue) -> { - consumer.accept(leftValue, rightValue); - - return null; - }); - } + public MergedType merge( + BiFunction merger); } -- cgit v1.2.3