diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-11-10 19:44:22 -0500 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-11-10 19:44:22 -0500 |
| commit | ba9cf27de7e9f31dfa97a7266979f300101d67f9 (patch) | |
| tree | dbf938e02d647e1be519808f8a14c6e954cab732 /BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java | |
| parent | 5cf7bcf156970fe72f79e40b8a6e320ea160ac83 (diff) | |
Doc updates
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java b/BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java index 72c0bdf..58c375b 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java @@ -4,6 +4,9 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; +/* + * A lazy pair, with only one side bound + */ class HalfBoundLazyPair<OldType, NewLeft, NewRight> implements IPair<NewLeft, NewRight> { private Supplier<OldType> oldSupplier; @@ -21,10 +24,9 @@ class HalfBoundLazyPair<OldType, NewLeft, NewRight> @Override public <BoundLeft, BoundRight> IPair<BoundLeft, BoundRight> bind( - BiFunction<NewLeft, NewRight, - IPair<BoundLeft, BoundRight>> bindr) { - IHolder<IPair<NewLeft, - NewRight>> newPair = new Identity<>(boundPair); + BiFunction<NewLeft, NewRight, IPair<BoundLeft, BoundRight>> bindr) { + IHolder<IPair<NewLeft, NewRight>> newPair = new Identity<>( + boundPair); IHolder<Boolean> newPairMade = new Identity<>(pairBound); Supplier<NewLeft> leftSupp = () -> { @@ -81,13 +83,10 @@ class HalfBoundLazyPair<OldType, NewLeft, NewRight> } @Override - public <OtherLeft, OtherRight, CombinedLeft, - CombinedRight> IPair<CombinedLeft, CombinedRight> combine( - IPair<OtherLeft, OtherRight> otherPair, - BiFunction<NewLeft, OtherLeft, - CombinedLeft> leftCombiner, - BiFunction<NewRight, OtherRight, - CombinedRight> rightCombiner) { + public <OtherLeft, OtherRight, CombinedLeft, CombinedRight> IPair<CombinedLeft, CombinedRight> combine( + IPair<OtherLeft, OtherRight> otherPair, + BiFunction<NewLeft, OtherLeft, CombinedLeft> leftCombiner, + BiFunction<NewRight, OtherRight, CombinedRight> rightCombiner) { return otherPair.bind((otherLeft, otherRight) -> { return bind((leftVal, rightVal) -> { return new LazyPair<>( |
