diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-11-16 11:22:33 -0500 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-11-16 11:22:33 -0500 |
| commit | f0e585d22c24eec3a723c6f0ea2a18252c570303 (patch) | |
| tree | ddeefae2872ee21e507131a8f08465cc81713c0f /BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java | |
| parent | d02e409ef8a389101970e70a105d30b7b1948ecf (diff) | |
Documentation update
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 | 23 |
1 files changed, 19 insertions, 4 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 cafa80f..94571f5 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java @@ -219,10 +219,8 @@ public class ListUtils { /* * Run up to a certain number of passes */ - for (int numberOfIterations = 0; - numberOfIterations < MAX_NTRIESPART - && !rejectedElements.isEmpty(); - numberOfIterations++) { + for (int numberOfIterations = 0; numberOfIterations < MAX_NTRIESPART + && !rejectedElements.isEmpty(); numberOfIterations++) { input.forEach(new GroupPartIteration<>(returnedList, currentPartition, rejectedElements, numberInCurrentPartition, numberPerPartition, @@ -266,6 +264,23 @@ public class ListUtils { return returnedList; } + /** + * Pad the provided list out to the desired size + * + * @param <E> + * The type of elements in the list + * @param list + * The list to pad out + * @param counter + * The function to count elements with + * @param size + * The desired size of the list + * @param padSource + * The function to get elements to pad with + * @return The list, padded to the desired size + * @throws IllegalArgumentException + * if the list couldn't be padded to the desired size + */ public static <E> IList<E> padList(IList<E> list, Function<E, Integer> counter, int size, Supplier<E> padSource) { |
