public abstract class CollectionsUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <E> boolean |
addAll(Collection<E> coll,
Iterable<? extends E> it)
Adds all elements from an iterable to a collection.
|
static <T> Iterable<List<T>> |
allCombinations(Iterable<T>... iterables) |
static <T> Iterable<List<T>> |
allTuples(Iterable<T> domain,
int length) |
static <T> Iterable<List<T>> |
allTuples(Iterable<T> domain,
int minLength,
int maxLength) |
static List<Character> |
charRange(char start,
char end) |
static List<Integer> |
intRange(int start,
int end) |
static List<Integer> |
intRange(int start,
int end,
int step) |
static <E> List<E> |
nullList(int size)
Retrieves an unmodifiable list only containing null values
of the given size.
|
static <T> List<? extends T> |
randomAccessList(Collection<? extends T> coll) |
static <E> E |
removeReplace(List<E> list,
int index) |
public static <E> boolean addAll(Collection<E> coll, Iterable<? extends E> it)
E
- element class.coll
- the collection to which the elements are added.it
- the iterable providing the elements to add.true
if the collection was modified,
false
otherwise.public static <E> List<E> nullList(int size)
size
- the sizepublic static <E> E removeReplace(List<E> list, int index)
public static <T> List<? extends T> randomAccessList(Collection<? extends T> coll)
public static <T> Iterable<List<T>> allTuples(Iterable<T> domain, int minLength, int maxLength)
@SafeVarargs public static <T> Iterable<List<T>> allCombinations(Iterable<T>... iterables)
Copyright © 2015. All Rights Reserved.