diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-07-28 16:44:36 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-07-28 16:44:36 -0400 |
| commit | dca8e9f586fd595a7995f07788318fb92b8cce79 (patch) | |
| tree | 4fdf216d4a30c2c663d4a429f79cfa471c8579c4 /BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java | |
| parent | b1317e5e62bb044cd8a676cb3fc2da86e9922caf (diff) | |
Format/Cleanup pass
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java | 30 |
1 files changed, 11 insertions, 19 deletions
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<String> deAffixTokens( - IList<String> input, + public static IList<String> deAffixTokens(IList<String> input, Deque<IPair<String, String>> 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<IList<String>> returnedList = new Identity<>( - input); + IHolder<IList<String>> 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 <E> IList<E> drawWithoutReplacement( - IList<E> list, int numberOfItems, - Function<Integer, Integer> rng) { + public static <E> IList<E> drawWithoutReplacement(IList<E> list, + int numberOfItems, Function<Integer, Integer> rng) { IList<E> 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 <E> IList<E> drawWithReplacement( - IList<E> list, int numberOfItems, - Function<Integer, Integer> rng) { + public static <E> IList<E> drawWithReplacement(IList<E> list, + int numberOfItems, Function<Integer, Integer> rng) { IList<E> 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 <E> IList<IList<E>> groupPartition( - IList<E> input, Function<E, Integer> elementCounter, - int numberPerPartition) { + public static <E> IList<IList<E>> groupPartition(IList<E> input, + Function<E, Integer> 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 <E> IList<E> mergeLists( - IList<E>... lists) { + public static <E> IList<E> mergeLists(IList<E>... lists) { IList<E> returnedList = new FunctionalList<>(); for (IList<E> list : lists) { @@ -279,8 +273,7 @@ public class ListUtils { * @return A list of tokens split on all the operators * */ - public static IList<String> splitTokens( - IList<String> input, + public static IList<String> splitTokens(IList<String> input, Deque<IPair<String, String>> 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<IList<String>> returnedList = new Identity<>( - input); + IHolder<IList<String>> returnedList = new Identity<>(input); operators.forEach((operator) -> { returnedList.transform((oldReturn) -> { |
