From df94066e3af02ff02d5ab4d033a3d603f743234c Mon Sep 17 00:00:00 2001 From: bjculkin Date: Mon, 12 Feb 2018 22:45:04 -0500 Subject: Formatting pass --- .../bjc/utils/funcutils/GroupPartIteration.java | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'base/src/main/java/bjc/utils/funcutils/GroupPartIteration.java') diff --git a/base/src/main/java/bjc/utils/funcutils/GroupPartIteration.java b/base/src/main/java/bjc/utils/funcutils/GroupPartIteration.java index 9e4b43a..a406c1c 100644 --- a/base/src/main/java/bjc/utils/funcutils/GroupPartIteration.java +++ b/base/src/main/java/bjc/utils/funcutils/GroupPartIteration.java @@ -12,19 +12,19 @@ import bjc.utils.funcdata.IList; * @author ben * * @param - * The type of element in the list being partitioned + * The type of element in the list being partitioned */ final class GroupPartIteration implements Consumer { /* The list we're returning. */ private final IList> returnedList; /* The current partition of the list. */ - public IList currentPartition; + public IList currentPartition; /* The items rejected from the current partition. */ private final IList rejectedItems; /* The number of items in the current partition. */ - private int numberInCurrentPartition; + private int numberInCurrentPartition; /* The number of items in each partition. */ private final int numberPerPartition; @@ -35,17 +35,18 @@ final class GroupPartIteration implements Consumer { * Create a new group partitioning iteration. * * @param returned - * The list containing all of the existing partitions. + * The list containing all of the existing partitions. * * @param rejects - * The items that have been rejected from a partition for being too - * large. + * The items that have been rejected from a partition for being + * too large. * * @param nPerPart - * The combined value of items that should go into each partition. + * The combined value of items that should go into each + * partition. * * @param eleCount - * The function to use to determine the value of an item. + * The function to use to determine the value of an item. */ public GroupPartIteration(final IList> returned, final IList rejects, final int nPerPart, final Function eleCount) { @@ -62,7 +63,7 @@ final class GroupPartIteration implements Consumer { public void accept(final E value) { final boolean shouldStartPartition = numberInCurrentPartition >= numberPerPartition; - if (shouldStartPartition) { + if(shouldStartPartition) { returnedList.add(currentPartition); currentPartition = new FunctionalList<>(); @@ -70,10 +71,10 @@ final class GroupPartIteration implements Consumer { } else { final int currentElementCount = elementCounter.apply(value); - final boolean shouldReject = - (numberInCurrentPartition + currentElementCount) >= numberPerPartition; + final boolean shouldReject = (numberInCurrentPartition + + currentElementCount) >= numberPerPartition; - if (shouldReject) { + if(shouldReject) { rejectedItems.add(value); } else { currentPartition.add(value); -- cgit v1.2.3