From 504ca816530efdff06bc202e0432ebd354aec304 Mon Sep 17 00:00:00 2001 From: EVE Date: Tue, 14 Mar 2017 12:07:14 -0400 Subject: Cleanup --- .../utils/data/internals/HalfBoundLazyPair.java | 38 +++++++++------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/internals/HalfBoundLazyPair.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/internals/HalfBoundLazyPair.java b/BJC-Utils2/src/main/java/bjc/utils/data/internals/HalfBoundLazyPair.java index a8bdb6a..c5e9c9f 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/internals/HalfBoundLazyPair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/internals/HalfBoundLazyPair.java @@ -1,14 +1,14 @@ package bjc.utils.data.internals; -import java.util.function.BiFunction; -import java.util.function.Function; -import java.util.function.Supplier; - import bjc.utils.data.IHolder; import bjc.utils.data.IPair; import bjc.utils.data.Identity; import bjc.utils.data.LazyPair; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Supplier; + /* * A lazy pair, with only one side bound */ @@ -17,8 +17,8 @@ public class HalfBoundLazyPair implements IPair> binder; - private IPair boundPair; - private boolean pairBound; + private IPair boundPair; + private boolean pairBound; public HalfBoundLazyPair(Supplier oldSupp, Function> bindr) { oldSupplier = oldSupp; @@ -32,7 +32,7 @@ public class HalfBoundLazyPair implements IPair newPairMade = new Identity<>(pairBound); Supplier leftSupp = () -> { - if (!newPairMade.getValue()) { + if(!newPairMade.getValue()) { newPair.replace(binder.apply(oldSupplier.get())); newPairMade.replace(true); } @@ -41,7 +41,7 @@ public class HalfBoundLazyPair implements IPair rightSupp = () -> { - if (!newPairMade.getValue()) { + if(!newPairMade.getValue()) { newPair.replace(binder.apply(oldSupplier.get())); newPairMade.replace(true); } @@ -58,7 +58,7 @@ public class HalfBoundLazyPair implements IPair leftSupp = () -> { IPair newPair = boundPair; - if (!pairBound) { + if(!pairBound) { newPair = binder.apply(oldSupplier.get()); } @@ -74,7 +74,7 @@ public class HalfBoundLazyPair implements IPair rightSupp = () -> { IPair newPair = boundPair; - if (!pairBound) { + if(!pairBound) { newPair = binder.apply(oldSupplier.get()); } @@ -100,9 +100,7 @@ public class HalfBoundLazyPair implements IPair IPair mapLeft(Function mapper) { Supplier leftSupp = () -> { - if (pairBound) { - return mapper.apply(boundPair.getLeft()); - } + if(pairBound) return mapper.apply(boundPair.getLeft()); NewLeft leftVal = binder.apply(oldSupplier.get()).getLeft(); @@ -110,9 +108,7 @@ public class HalfBoundLazyPair implements IPair rightSupp = () -> { - if (pairBound) { - return boundPair.getRight(); - } + if(pairBound) return boundPair.getRight(); return binder.apply(oldSupplier.get()).getRight(); }; @@ -123,17 +119,13 @@ public class HalfBoundLazyPair implements IPair IPair mapRight(Function mapper) { Supplier leftSupp = () -> { - if (pairBound) { - return boundPair.getLeft(); - } + if(pairBound) return boundPair.getLeft(); return binder.apply(oldSupplier.get()).getLeft(); }; Supplier rightSupp = () -> { - if (pairBound) { - return mapper.apply(boundPair.getRight()); - } + if(pairBound) return mapper.apply(boundPair.getRight()); NewRight rightVal = binder.apply(oldSupplier.get()).getRight(); @@ -145,7 +137,7 @@ public class HalfBoundLazyPair implements IPair MergedType merge(BiFunction merger) { - if (!pairBound) { + if(!pairBound) { boundPair = binder.apply(oldSupplier.get()); pairBound = true; -- cgit v1.2.3