java.lang.Object
org.evrete.util.CollectionUtils
The
CollectionUtils class provides utility methods for working with collections.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T[]static <E,T extends Collection<E>>
Collection<List<E>>combinations(Collection<T> sources) For argument like [[a1, a2, a3], [b1, b2], [c1, c2]] method returns collection of size L = a.size() * b.size() * c.size() = 12 where each entry is a combination of the three input sources: [a1, b1 ,c1], [a1, b1, c2], [a1, b2, c1] ....static <T> T[]copyOf(T[] arr) static <T> ReIterator<T>permutation(List<E> l) static voidsystemFill(boolean[] array, boolean value) static voidsystemFill(int[] array, int value) static <T> voidsystemFill(T[] array, T value)
-
Constructor Details
-
CollectionUtils
public CollectionUtils()
-
-
Method Details
-
array
-
copyOf
public static <T> T[] copyOf(T[] arr) -
emptyReIterator
-
permutation
-
combinations
For argument like [[a1, a2, a3], [b1, b2], [c1, c2]] method returns collection of size L = a.size() * b.size() * c.size() = 12 where each entry is a combination of the three input sources: [a1, b1 ,c1], [a1, b1, c2], [a1, b2, c1] .... [a3, b3, c2]- Type Parameters:
E- source type parameterT- collection type parameter- Parameters:
sources- input collections- Returns:
- all possible combinations
-
systemFill
public static void systemFill(int[] array, int value) -
systemFill
public static void systemFill(boolean[] array, boolean value) -
systemFill
public static <T> void systemFill(T[] array, T value)
-