From dca8e9f586fd595a7995f07788318fb92b8cce79 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 28 Jul 2016 16:44:36 -0400 Subject: Format/Cleanup pass --- .../main/java/bjc/utils/funcutils/ListUtils.java | 30 ++++++++-------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java b/BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java index 913ccc4..f09a794 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java @@ -78,8 +78,7 @@ public class ListUtils { * @return The tokens that have been deaffixed * */ - public static IList deAffixTokens( - IList input, + public static IList deAffixTokens(IList input, Deque> operators) { if (input == null) { throw new NullPointerException("Input must not be null"); @@ -88,8 +87,7 @@ public class ListUtils { "Set of operators must not be null"); } - IHolder> returnedList = new Identity<>( - input); + IHolder> returnedList = new Identity<>(input); operators.forEach((operator) -> returnedList .transform((oldReturn) -> oldReturn.flatMap((token) -> { @@ -115,9 +113,8 @@ public class ListUtils { * selected from the specified list without replacement */ - public static IList drawWithoutReplacement( - IList list, int numberOfItems, - Function rng) { + public static IList drawWithoutReplacement(IList list, + int numberOfItems, Function rng) { IList selectedItems = new FunctionalList<>( new ArrayList<>(numberOfItems)); @@ -153,9 +150,8 @@ public class ListUtils { * @return A new list containing the desired number of items randomly * selected from the specified list */ - public static IList drawWithReplacement( - IList list, int numberOfItems, - Function rng) { + public static IList drawWithReplacement(IList list, + int numberOfItems, Function rng) { IList selectedItems = new FunctionalList<>( new ArrayList<>(numberOfItems)); @@ -181,9 +177,8 @@ public class ListUtils { * The number of elements to put in each partition * @return A list partitioned according to the above rules */ - public static IList> groupPartition( - IList input, Function elementCounter, - int numberPerPartition) { + public static IList> groupPartition(IList input, + Function elementCounter, int numberPerPartition) { if (input == null) { throw new NullPointerException("Input list must not be null"); } else if (elementCounter == null) { @@ -254,8 +249,7 @@ public class ListUtils { * @return A list containing all the elements of the lists */ @SafeVarargs - public static IList mergeLists( - IList... lists) { + public static IList mergeLists(IList... lists) { IList returnedList = new FunctionalList<>(); for (IList list : lists) { @@ -279,8 +273,7 @@ public class ListUtils { * @return A list of tokens split on all the operators * */ - public static IList splitTokens( - IList input, + public static IList splitTokens(IList input, Deque> operators) { if (input == null) { throw new NullPointerException("Input must not be null"); @@ -289,8 +282,7 @@ public class ListUtils { "Set of operators must not be null"); } - IHolder> returnedList = new Identity<>( - input); + IHolder> returnedList = new Identity<>(input); operators.forEach((operator) -> { returnedList.transform((oldReturn) -> { -- cgit v1.2.3