From b65b705c391bb772bc41269bce5243c1cc88969d Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Fri, 22 Apr 2016 14:29:05 -0400 Subject: Formatting changes --- .../java/bjc/utils/funcdata/FunctionalList.java | 38 ++++++++++------------ 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java b/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java index 735c664..c8f2269 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java @@ -1,5 +1,6 @@ package bjc.utils.funcdata; +import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; @@ -16,8 +17,6 @@ import bjc.utils.data.IPair; import bjc.utils.data.Identity; import bjc.utils.data.Pair; -import java.util.ArrayList; - /** * A wrapper over another list that provides eager functional operations * over it. Differs from a stream in every way except for the fact that @@ -182,8 +181,8 @@ public class FunctionalList implements Cloneable, IFunctionalList { // Get the iterator for the other list Iterator rightIterator = rightList.toIterable().iterator(); - for (Iterator leftIterator = - wrappedList.iterator(); leftIterator.hasNext() + for (Iterator leftIterator = wrappedList + .iterator(); leftIterator.hasNext() && rightIterator.hasNext();) { // Add the transformed items to the result list E leftVal = leftIterator.next(); @@ -228,18 +227,18 @@ public class FunctionalList implements Cloneable, IFunctionalList { * Function) */ @Override - public IFunctionalList - flatMap(Function> elementExpander) { + public IFunctionalList flatMap( + Function> elementExpander) { if (elementExpander == null) { throw new NullPointerException("Expander must not be null"); } - IFunctionalList returnedList = - new FunctionalList<>(this.wrappedList.size()); + IFunctionalList returnedList = new FunctionalList<>( + this.wrappedList.size()); forEach(element -> { - IFunctionalList expandedElement = - elementExpander.apply(element); + IFunctionalList expandedElement = elementExpander + .apply(element); if (expandedElement == null) { throw new NullPointerException( @@ -370,8 +369,8 @@ public class FunctionalList implements Cloneable, IFunctionalList { throw new NullPointerException("Transformer must be not null"); } - IFunctionalList returnedList = - new FunctionalList<>(this.wrappedList.size()); + IFunctionalList returnedList = new FunctionalList<>( + this.wrappedList.size()); forEach(element -> { // Add the transformed item to the result @@ -388,8 +387,8 @@ public class FunctionalList implements Cloneable, IFunctionalList { * IFunctionalList) */ @Override - public IFunctionalList> - pairWith(IFunctionalList rightList) { + public IFunctionalList> pairWith( + IFunctionalList rightList) { return combineWith(rightList, Pair::new); } @@ -399,8 +398,8 @@ public class FunctionalList implements Cloneable, IFunctionalList { * @see bjc.utils.funcdata.IFunctionalList#partition(int) */ @Override - public IFunctionalList> - partition(int numberPerPartition) { + public IFunctionalList> partition( + int numberPerPartition) { if (numberPerPartition < 1 || numberPerPartition > wrappedList.size()) { throw new IllegalArgumentException("" + numberPerPartition @@ -408,12 +407,11 @@ public class FunctionalList implements Cloneable, IFunctionalList { + wrappedList.size()); } - IFunctionalList> returnedList = - new FunctionalList<>(); + IFunctionalList> returnedList = new FunctionalList<>(); // The current partition being filled - IHolder> currentPartition = - new Identity<>(new FunctionalList<>()); + IHolder> currentPartition = new Identity<>( + new FunctionalList<>()); this.forEach((element) -> { if (isPartitionFull(numberPerPartition, currentPartition)) { -- cgit v1.2.3