From 61fd71f69e080790da722e0e03b71ecd7c2538a2 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 10 May 2016 16:02:45 -0400 Subject: General update --- .../java/bjc/utils/funcdata/FunctionalList.java | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java b/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java index 8579693..638ad7e 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalList.java @@ -27,7 +27,7 @@ import bjc.utils.data.Pair; * @param * The type in this list */ -public class FunctionalList implements Cloneable, IFunctionalList { +public class FunctionalList implements Cloneable, IList { /** * The list used as a backing store */ @@ -148,8 +148,8 @@ public class FunctionalList implements Cloneable, IFunctionalList { * @return A list */ @Override - public IFunctionalList clone() { - IFunctionalList clonedList = new FunctionalList<>(); + public IList clone() { + IList clonedList = new FunctionalList<>(); for (E element : wrappedList) { clonedList.add(element); @@ -166,8 +166,8 @@ public class FunctionalList implements Cloneable, IFunctionalList { * IFunctionalList, java.util.function.BiFunction) */ @Override - public IFunctionalList combineWith( - IFunctionalList rightList, + public IList combineWith( + IList rightList, BiFunction itemCombiner) { if (rightList == null) { throw new NullPointerException( @@ -176,7 +176,7 @@ public class FunctionalList implements Cloneable, IFunctionalList { throw new NullPointerException("Combiner must not be null"); } - IFunctionalList returnedList = new FunctionalList<>(); + IList returnedList = new FunctionalList<>(); // Get the iterator for the other list Iterator rightIterator = rightList.toIterable().iterator(); @@ -227,17 +227,17 @@ public class FunctionalList implements Cloneable, IFunctionalList { * Function) */ @Override - public IFunctionalList flatMap( - Function> elementExpander) { + public IList flatMap( + Function> elementExpander) { if (elementExpander == null) { throw new NullPointerException("Expander must not be null"); } - IFunctionalList returnedList = new FunctionalList<>( + IList returnedList = new FunctionalList<>( this.wrappedList.size()); forEach(element -> { - IFunctionalList expandedElement = elementExpander + IList expandedElement = elementExpander .apply(element); if (expandedElement == null) { @@ -320,12 +320,12 @@ public class FunctionalList implements Cloneable, IFunctionalList { * Predicate) */ @Override - public IFunctionalList getMatching(Predicate matchPredicate) { + public IList getMatching(Predicate matchPredicate) { if (matchPredicate == null) { throw new NullPointerException("Predicate must not be null"); } - IFunctionalList returnedList = new FunctionalList<>(); + IList returnedList = new FunctionalList<>(); wrappedList.forEach((element) -> { if (matchPredicate.test(element)) { @@ -361,7 +361,7 @@ public class FunctionalList implements Cloneable, IFunctionalList { * Check if a partition has room for another item */ private Boolean isPartitionFull(int numberPerPartition, - IHolder> currentPartition) { + IHolder> currentPartition) { return currentPartition.unwrap( (partition) -> partition.getSize() >= numberPerPartition); } @@ -373,12 +373,12 @@ public class FunctionalList implements Cloneable, IFunctionalList { * bjc.utils.funcdata.IFunctionalList#map(java.util.function.Function) */ @Override - public IFunctionalList map(Function elementTransformer) { + public IList map(Function elementTransformer) { if (elementTransformer == null) { throw new NullPointerException("Transformer must be not null"); } - IFunctionalList returnedList = new FunctionalList<>( + IList returnedList = new FunctionalList<>( this.wrappedList.size()); forEach(element -> { @@ -396,8 +396,8 @@ public class FunctionalList implements Cloneable, IFunctionalList { * IFunctionalList) */ @Override - public IFunctionalList> pairWith( - IFunctionalList rightList) { + public IList> pairWith( + IList rightList) { return combineWith(rightList, Pair::new); } @@ -407,7 +407,7 @@ public class FunctionalList implements Cloneable, IFunctionalList { * @see bjc.utils.funcdata.IFunctionalList#partition(int) */ @Override - public IFunctionalList> partition( + public IList> partition( int numberPerPartition) { if (numberPerPartition < 1 || numberPerPartition > wrappedList.size()) { @@ -416,10 +416,10 @@ public class FunctionalList implements Cloneable, IFunctionalList { + wrappedList.size()); } - IFunctionalList> returnedList = new FunctionalList<>(); + IList> returnedList = new FunctionalList<>(); // The current partition being filled - IHolder> currentPartition = new Identity<>( + IHolder> currentPartition = new Identity<>( new FunctionalList<>()); this.forEach((element) -> { @@ -559,7 +559,7 @@ public class FunctionalList implements Cloneable, IFunctionalList { } @Override - public IFunctionalList tail() { + public IList tail() { return new FunctionalList<>(wrappedList.subList(1, getSize())); } -- cgit v1.2.3