diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-03-22 12:28:35 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-03-22 12:28:35 -0400 |
| commit | 01cb9f504c860bc1c037a44f3a76bf342a293d46 (patch) | |
| tree | 02d1d34de0828159bbda93e881c93a6b45720f32 /BJC-Utils2/src/main/java/bjc/utils/data/IPair.java | |
| parent | 4685955a62c430007c5c8ed2b915ffc618d30aca (diff) | |
General formatting cleanup and documentation update
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/IPair.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/data/IPair.java | 34 |
1 files changed, 25 insertions, 9 deletions
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 <L> + * The type stored in the left side of the pair + * @param <R> + * The type stored in the right side of the pair + */ public interface IPair<L, R> { /** * Create a new pair by applying the given functions to the left/right. * Does not change the internal contents of this pair. * + * @param <L2> + * The new left type of the pair + * @param <R2> + * The new right type of the pair + * * @param lf * The function to apply to the left value. * @param rf @@ -20,21 +35,22 @@ public interface IPair<L, R> { Function<R, R2> 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<L, R> bc); + + /** * Collapse this pair to a single value. Does not change the internal * contents of this pair. + * @param <E> The resulting type after merging * * @param bf * The function to use to collapse the pair. * @return The collapsed value. */ public <E> E merge(BiFunction<L, R, E> 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<L, R> bc); }
\ No newline at end of file |
