|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectCollectionsExt
public final class CollectionsExt extends Object
| Modifier and Type | Method and Description | |
|---|---|---|
static
|
addToArray(T[] array,
T el)
Creates and returns an array that contains all elements of the array parameter and has the el parameter appened. |
|
static
|
allCombinations(List<List<T>> inputs)
For a given list of list of objects, create and return the (exponential in size) list of list of objects that comes from combining the every element from the first list with every element from the second list etc. |
|
static boolean |
allInstancesOf(Class<?> clazz,
Object[] objs)
Returns whether all objects are instances of a given class. |
|
static boolean |
areDisjoint(Set<?>... ss)
Returns whether the sets are disjoint. |
|
static
|
chunkUp(List<T> list,
int maxLength)
Divides the argument into chunks of at most the given length. |
|
static
|
concat(List<? extends T>... lists)
Returns an ArrayList that is a concatenation of the arguments. |
|
static
|
concatAll(Collection<? extends List<? extends T>> lists)
Returns an ArrayList that is a concatenation of the arguments. |
|
static
|
containsEquivalent(Collection<T> c,
Object o,
Hasher h)
Returns true iff the collection contains an element equivalent to the given one, as decided by the hasher. |
|
static
|
containsIdentical(Collection<T> c,
Object o)
Returns true iff the collection contains the element. |
|
static Map<Integer,Set<Object[]>> |
createPerArityGroups(Object[] objects,
int max)
Creates a set of all sequences of length max of objects. |
|
static
|
diff(Set<? extends T> s1,
Set<? extends T> s2)
|
|
static SortedSet<Integer> |
findAll(List<?> list,
Object elem)
|
|
static
|
getAll(Enumeration<T> e)
|
|
static
|
getNthIteratedElement(Collection<? extends T> s,
int index)
|
|
static
|
getNthIteratedElement(Iterator<? extends T> iter,
int index)
|
|
static
|
intersection(Set<? extends T>... sets)
|
|
static String |
join(String separator,
List<String> strings)
Reverse of String.split. |
|
static
|
map(List<T> values,
Map<T,T> map)
Maps all values to new values. |
|
static List<String> |
prefix(String prefix,
List<String> lines)
Adds prefix to each line. |
|
static
|
removeMatching(String pattern,
T strings)
Removed from the collection all strings that match the given pattern. |
|
static
|
roCopyList(Collection<T> l)
Return a unmodifiable list that has all elements of the given collection. |
|
static List<String> |
sort(List<String> strings)
Sort and return the list. |
|
static String |
toStringInLines(Collection<?> c)
Prints out the String.valueOf() of all elements of the collection, inserting a new line after each element. |
|
static String |
toStringInSortedLines(Collection<?> c)
Prints out the elements of the collection in lines, in lexicographic order of String.valueOf called on each element. |
|
static List<String> |
toStringLines(Collection<?> c)
List of String.valueOf() of all elements of the collection. |
|
static
|
union(Set<? extends T>... sets)
|
|
static
|
unique(List<T> lst)
Make a copy of the list with duplicates removed. |
|
static
|
xor(Set<? extends T> s1,
Set<? extends T> s2)
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> List<T> unique(List<T> lst)
public static <T> List<T> roCopyList(Collection<T> l)
public static <T> Set<T> intersection(Set<? extends T>... sets)
public static <T> Set<T> xor(Set<? extends T> s1,
Set<? extends T> s2)
public static <T> Set<T> diff(Set<? extends T> s1,
Set<? extends T> s2)
public static <T> Set<T> union(Set<? extends T>... sets)
public static <T> List<T> concat(List<? extends T>... lists)
public static <T> List<T> concatAll(Collection<? extends List<? extends T>> lists)
public static <T> T getNthIteratedElement(Collection<? extends T> s,
int index)
public static <T> T getNthIteratedElement(Iterator<? extends T> iter,
int index)
public static SortedSet<Integer> findAll(List<?> list,
Object elem)
public static String toStringInLines(Collection<?> c)
public static String toStringInSortedLines(Collection<?> c)
public static List<String> toStringLines(Collection<?> c)
public static List<String> sort(List<String> strings)
public static <T> List<List<T>> chunkUp(List<T> list,
int maxLength)
public static <T> Set<T> getAll(Enumeration<T> e)
public static <T extends Collection<String>> T removeMatching(String pattern,
T strings)
public static String join(String separator,
List<String> strings)
public static List<String> prefix(String prefix,
List<String> lines)
public static boolean areDisjoint(Set<?>... ss)
public static Map<Integer,Set<Object[]>> createPerArityGroups(Object[] objects,
int max)
public static <T> T[] addToArray(T[] array,
T el)
public static boolean allInstancesOf(Class<?> clazz,
Object[] objs)
public static <T> List<List<T>> allCombinations(List<List<T>> inputs)
public static <T> boolean containsIdentical(Collection<T> c,
Object o)
public static <T> boolean containsEquivalent(Collection<T> c,
Object o,
Hasher h)
public static <T> List<T> map(List<T> values,
Map<T,T> map)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||