diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-05-10 21:58:08 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-05-10 21:58:08 -0400 |
| commit | fff6dc5d43539af05ae2679640240b8545b36947 (patch) | |
| tree | 89dc91bdc013415b76351a22126bffe86a750d7d /BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java | |
| parent | 507f506093c84ae764d0c26b24d9d055e8613aae (diff) | |
Added interface to JDK collector API
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 | 15 |
1 files changed, 15 insertions, 0 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 9e26924..198dd96 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/HalfBoundLazyPair.java @@ -138,4 +138,19 @@ class HalfBoundLazyPair<OldType, NewLeft, NewRight> return new LazyPair<>(leftSupp, rightSupp); } + + @Override + 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<>( + leftCombiner.apply(leftVal, otherLeft), + rightCombiner.apply(rightVal, otherRight)); + }); + }); + } }
\ No newline at end of file |
