From 27bf571d6413c3cc6a5d664b5bddd38d21d7b1cd Mon Sep 17 00:00:00 2001 From: EVE Date: Mon, 13 Mar 2017 16:42:21 -0400 Subject: Formatting --- .../src/main/java/bjc/utils/funcdata/IList.java | 114 ++++++++++----------- 1 file changed, 56 insertions(+), 58 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcdata/IList.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcdata/IList.java b/BJC-Utils2/src/main/java/bjc/utils/funcdata/IList.java index f6b207a..0feaf06 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcdata/IList.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcdata/IList.java @@ -17,14 +17,14 @@ import bjc.utils.data.IPair; * @author ben * * @param - * The type in this list + * The type in this list */ public interface IList extends Iterable { /** * Add an item to this list * * @param item - * The item to add to this list. + * The item to add to this list. * @return Whether the item was added to the list successfully. */ boolean add(ContainedType item); @@ -33,7 +33,7 @@ public interface IList extends Iterable { * Add all of the elements in the provided list to this list * * @param items - * The list of items to add + * The list of items to add * @return True if every item was successfully added to the list, false * otherwise */ @@ -46,7 +46,7 @@ public interface IList extends Iterable { * predicate. * * @param matcher - * The predicate to use for checking. + * The predicate to use for checking. * @return Whether all of the elements of the list match the specified * predicate. */ @@ -56,7 +56,7 @@ public interface IList extends Iterable { * Check if any of the elements in this list match the specified list. * * @param matcher - * The predicate to use for checking. + * The predicate to use for checking. * @return Whether any element in the list matches the provided * predicate. */ @@ -66,11 +66,11 @@ public interface IList extends Iterable { * Reduce the contents of this list using a collector * * @param - * The intermediate accumulation type + * The intermediate accumulation type * @param - * The final, reduced type + * The final, reduced type * @param collector - * The collector to use for reduction + * The collector to use for reduction * @return The reduced list */ default ReducedType collect( @@ -88,32 +88,31 @@ public interface IList extends Iterable { * Combine this list with another one into a new list and merge the * results. * - * Works sort of like a combined zip/map over resulting pairs. - * Does not change the underlying list. + * Works sort of like a combined zip/map over resulting pairs. Does not + * change the underlying list. * * NOTE: The returned list will have the length of the shorter of this * list and the combined one. * * @param - * The type of the second list + * The type of the second list * @param - * The type of the combined list + * The type of the combined list * * @param list - * The list to combine with + * The list to combine with * @param combiner - * The function to use for combining element pairs. + * The function to use for combining element pairs. * @return A new list containing the merged pairs of lists. */ - IList combineWith( - IList list, + IList combineWith(IList list, BiFunction combiner); /** * Check if the list contains the specified item * * @param item - * The item to see if it is contained + * The item to see if it is contained * @return Whether or not the specified item is in the list */ boolean contains(ContainedType item); @@ -132,21 +131,20 @@ public interface IList extends Iterable { * Does not change the underlying list. * * @param - * The type of the flattened list + * The type of the flattened list * * @param expander - * The function to apply to each member of the list. + * The function to apply to each member of the list. * @return A new list containing the flattened results of applying the * provided function. */ - IList flatMap( - Function> expander); + IList flatMap(Function> expander); /** * Apply a given action for each member of the list * * @param action - * The action to apply to each member of the list. + * The action to apply to each member of the list. */ void forEach(Consumer action); @@ -154,8 +152,8 @@ public interface IList extends Iterable { * Apply a given function to each element in the list and its index. * * @param action - * The function to apply to each element in the list and its - * index. + * The function to apply to each element in the list and + * its index. */ void forEachIndexed(BiConsumer action); @@ -163,7 +161,7 @@ public interface IList extends Iterable { * Retrieve a value in the list by its index. * * @param index - * The index to retrieve a value from. + * The index to retrieve a value from. * @return The value at the specified index in the list. */ ContainedType getByIndex(int index); @@ -172,7 +170,7 @@ public interface IList extends Iterable { * Retrieve a list containing all elements matching a predicate * * @param predicate - * The predicate to match by + * The predicate to match by * @return A list containing all elements that match the predicate */ IList getMatching(Predicate predicate); @@ -193,28 +191,27 @@ public interface IList extends Iterable { /** * Create a new list by applying the given function to each element in - * the list. + * the list. * * Does not change the underlying list. * * @param - * The type of the transformed list + * The type of the transformed list * * @param transformer - * The function to apply to each element in the list + * The function to apply to each element in the list * @return A new list containing the mapped elements of this list. */ - IList map( - Function transformer); + IList map(Function transformer); /** * Zip two lists into a list of pairs * * @param - * The type of the second list + * The type of the second list * * @param list - * The list to use as the left side of the pair + * The list to use as the left side of the pair * @return A list containing pairs of this element and the specified * list */ @@ -224,7 +221,8 @@ public interface IList extends Iterable { * Partition this list into a list of sublists * * @param partitionSize - * The size of elements to put into each one of the sublists + * The size of elements to put into each one of the + * sublists * @return A list partitioned into partitions of size nPerPart */ IList> partition(int partitionSize); @@ -233,7 +231,7 @@ public interface IList extends Iterable { * Prepend an item to the list * * @param item - * The item to prepend to the list + * The item to prepend to the list */ void prepend(ContainedType item); @@ -248,11 +246,11 @@ public interface IList extends Iterable { } /** - * Select a random item from this list, using the provided random - * number generator. + * Select a random item from this list, using the provided random number + * generator. * * @param rnd - * The random number generator to use. + * The random number generator to use. * @return A random element from this list. */ ContainedType randItem(Function rnd); @@ -261,18 +259,18 @@ public interface IList extends Iterable { * Reduce this list to a single value, using a accumulative approach. * * @param - * The in-between type of the values + * The in-between type of the values * @param - * The final value type + * The final value type * * @param initial - * The initial value of the accumulative state. + * The initial value of the accumulative state. * @param accumulator - * The function to use to combine a list element with the - * accumulative state. + * The function to use to combine a list element with the + * accumulative state. * @param transformer - * The function to use to convert the accumulative state - * into a final result. + * The function to use to convert the accumulative state + * into a final result. * @return A single value condensed from this list and transformed into * its final state. */ @@ -284,7 +282,7 @@ public interface IList extends Iterable { * Remove all elements that match a given predicate * * @param predicate - * The predicate to use to determine elements to delete + * The predicate to use to determine elements to delete * @return Whether there was anything that satisfied the predicate */ boolean removeIf(Predicate predicate); @@ -293,7 +291,7 @@ public interface IList extends Iterable { * Remove all parameters that match a given parameter * * @param element - * The object to remove all matching copies of + * The object to remove all matching copies of */ void removeMatching(ContainedType element); @@ -304,29 +302,29 @@ public interface IList extends Iterable { /** * Perform a binary search for the specified key using the provided - * means of comparing elements. + * means of comparing elements. * - * Since this IS a binary search, the list must have been sorted before hand. + * Since this IS a binary search, the list must have been sorted before + * hand. * * @param key - * The key to search for. + * The key to search for. * @param comparator - * The way to compare elements for searching. Pass null to - * use the natural ordering for E + * The way to compare elements for searching. Pass null + * to use the natural ordering for E * @return The element if it is in this list, or null if it is not. */ - ContainedType search(ContainedType key, - Comparator comparator); + ContainedType search(ContainedType key, Comparator comparator); /** * Sort the elements of this list using the provided way of comparing - * elements. + * elements. * * Does change the underlying list. * * @param comparator - * The way to compare elements for sorting. Pass null to use - * E's natural ordering + * The way to compare elements for sorting. Pass null to + * use E's natural ordering */ void sort(Comparator comparator); @@ -341,7 +339,7 @@ public interface IList extends Iterable { * Convert this list into an array * * @param type - * The type of array to return + * The type of array to return * @return The list, as an array */ ContainedType[] toArray(ContainedType[] type); -- cgit v1.2.3