From 01cb9f504c860bc1c037a44f3a76bf342a293d46 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 22 Mar 2016 12:28:35 -0400 Subject: General formatting cleanup and documentation update --- BJC-Utils2/src/main/java/bjc/utils/data/IPair.java | 34 ++++++++++++++++------ 1 file changed, 25 insertions(+), 9 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 fcf2b05..9923099 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/IPair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/IPair.java @@ -4,12 +4,27 @@ import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; +/** + * An interface representing a pair of values + * + * @author ben + * + * @param + * The type stored in the left side of the pair + * @param + * The type stored in the right side of the pair + */ public interface IPair { /** * Create a new pair by applying the given functions to the left/right. * Does not change the internal contents of this pair. * + * @param + * The new left type of the pair + * @param + * The new right type of the pair + * * @param lf * The function to apply to the left value. * @param rf @@ -19,22 +34,23 @@ public interface IPair { public IPair apply(Function lf, Function rf); + /** + * Execute an action with the values of this pair. Has no effect on the + * internal contents + * + * @param bc + * The action to execute on the values + */ + public void doWith(BiConsumer bc); + /** * Collapse this pair to a single value. Does not change the internal * contents of this pair. + * @param The resulting type after merging * * @param bf * The function to use to collapse the pair. * @return The collapsed value. */ public E merge(BiFunction bf); - - /** - * Execute an action with the values of this pair. Has no effect on the - * internal contents - * - * @param bc - * The action to execute on the values - */ - public void doWith(BiConsumer bc); } \ No newline at end of file -- cgit v1.2.3