diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-13 23:11:36 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-13 23:11:36 -0400 |
| commit | 9adff31e86603493c2a245e1e803d951675d5e00 (patch) | |
| tree | 7374a6e4657333881db5621fbf23e18617470329 /BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java | |
| parent | ba07771f8333f1b098ab8a9ec9fec886b72b9cc0 (diff) | |
Implemented new tree abstraction
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 | 21 |
1 files changed, 11 insertions, 10 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 132e4c5..977186a 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/ListUtils.java @@ -6,8 +6,9 @@ import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; -import bjc.utils.data.GenHolder; -import bjc.utils.data.IPair; +import bjc.utils.data.experimental.IHolder; +import bjc.utils.data.experimental.IPair; +import bjc.utils.data.experimental.Identity; import bjc.utils.funcdata.FunctionalList; import bjc.utils.funcdata.IFunctionalList; @@ -115,17 +116,17 @@ public class ListUtils { private static final class GroupPartIteration<E> implements Consumer<E> { private IFunctionalList<IFunctionalList<E>> returnedList; - private GenHolder<IFunctionalList<E>> currentPartition; + private IHolder<IFunctionalList<E>> currentPartition; private IFunctionalList<E> rejectedItems; - private GenHolder<Integer> numberInCurrentPartition; + private IHolder<Integer> numberInCurrentPartition; private int numberPerPartition; private Function<E, Integer> elementCounter; public GroupPartIteration( IFunctionalList<IFunctionalList<E>> returned, - GenHolder<IFunctionalList<E>> currPart, + IHolder<IFunctionalList<E>> currPart, IFunctionalList<E> rejects, - GenHolder<Integer> numInCurrPart, int nPerPart, + IHolder<Integer> numInCurrPart, int nPerPart, Function<E, Integer> eleCount) { this.returnedList = returned; this.currentPartition = currPart; @@ -199,7 +200,7 @@ public class ListUtils { /* * List that holds current partition */ - GenHolder<IFunctionalList<E>> currentPartition = new GenHolder<>( + IHolder<IFunctionalList<E>> currentPartition = new Identity<>( new FunctionalList<>()); /* * List that holds elements rejected during current pass @@ -209,7 +210,7 @@ public class ListUtils { /* * The effective number of elements in the current partitition */ - GenHolder<Integer> numberInCurrentPartition = new GenHolder<>(0); + IHolder<Integer> numberInCurrentPartition = new Identity<>(0); /* * Run up to a certain number of passes @@ -263,7 +264,7 @@ public class ListUtils { "Set of operators must not be null"); } - GenHolder<IFunctionalList<String>> returnedList = new GenHolder<>( + IHolder<IFunctionalList<String>> returnedList = new Identity<>( input); operators.forEach((operator) -> returnedList @@ -294,7 +295,7 @@ public class ListUtils { "Set of operators must not be null"); } - GenHolder<IFunctionalList<String>> returnedList = new GenHolder<>( + IHolder<IFunctionalList<String>> returnedList = new Identity<>( input); operators.forEach((operator) -> returnedList |
