From 27bf571d6413c3cc6a5d664b5bddd38d21d7b1cd Mon Sep 17 00:00:00 2001 From: EVE Date: Mon, 13 Mar 2017 16:42:21 -0400 Subject: Formatting --- .../java/bjc/utils/data/internals/BoundLazy.java | 38 +++++++++------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazy.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazy.java b/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazy.java index beb2465..57bf006 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazy.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazy.java @@ -12,45 +12,42 @@ import bjc.utils.funcdata.IList; /** * Implements a lazy holder that has been bound */ -public class BoundLazy - implements IHolder { +public class BoundLazy implements IHolder { /* * The old value */ - private Supplier> oldSupplier; + private Supplier> oldSupplier; /* * The function to use to transform the old value into a new value */ - private Function> binder; + private Function> binder; /* * The bound value being held */ - private IHolder boundHolder; + private IHolder boundHolder; /* * Whether the bound value has been actualized or not */ - private boolean holderBound; + private boolean holderBound; /* * Transformations currently pending on the bound value */ - private IList> actions = new FunctionalList<>(); + private IList> actions = new FunctionalList<>(); /* * Create a new bound lazy value */ - public BoundLazy(Supplier> supp, - Function> binder) { + public BoundLazy(Supplier> supp, Function> binder) { oldSupplier = supp; this.binder = binder; } @Override - public IHolder bind( - Function> bindr) { + public IHolder bind(Function> bindr) { if (bindr == null) { throw new NullPointerException("Binder must not be null"); } @@ -89,8 +86,7 @@ public class BoundLazy public Function> lift( Function func) { if (func == null) { - throw new NullPointerException( - "Function to lift must not be null"); + throw new NullPointerException("Function to lift must not be null"); } return (val) -> { @@ -99,8 +95,7 @@ public class BoundLazy } @Override - public IHolder map( - Function mapper) { + public IHolder map(Function mapper) { if (mapper == null) { throw new NullPointerException("Mapper must not be null"); } @@ -118,10 +113,9 @@ public class BoundLazy oldHolder = oldSupplier.get().unwrap(binder); } - return pendingActions.reduceAux(oldHolder.getValue(), - (action, state) -> { - return action.apply(state); - }, (value) -> mapper.apply(value)); + return pendingActions.reduceAux(oldHolder.getValue(), (action, state) -> { + return action.apply(state); + }, (value) -> mapper.apply(value)); }; return new Lazy<>(typeSupplier); @@ -137,8 +131,7 @@ public class BoundLazy } @Override - public IHolder transform( - UnaryOperator transformer) { + public IHolder transform(UnaryOperator transformer) { if (transformer == null) { throw new NullPointerException("Transformer must not be null"); } @@ -149,8 +142,7 @@ public class BoundLazy } @Override - public UnwrappedType unwrap( - Function unwrapper) { + public UnwrappedType unwrap(Function unwrapper) { if (unwrapper == null) { throw new NullPointerException("Unwrapper must not be null"); } -- cgit v1.2.3