|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.utils.CollectionUtils
public final class CollectionUtils
This class provides a set of utility methods for manipulating and converting collections and arrays.
| Method Summary | ||
|---|---|---|
static
|
concatArrays(T[]... arrays)
Concatenate a set of array into a single array. |
|
static
|
formatSizeMapInfo(String name,
Map<T,List<U>> map)
Format a string with size information about a map whose values are lists of elements. |
|
static
|
getAllElements(List<T> source,
int start,
int size)
Generate a list that contains the specified number of elements of the specified list, starting at the specified position in the specified list. |
|
static
|
list(T... array)
Convert an array into a List. |
|
static
|
putInListMap(T key,
U value,
Map<T,List<U>> map)
Add an element in a map whose values are lists of elements. |
|
static
|
removeFromListMap(T key,
U value,
Map<T,List<U>> map)
Remove an element from a map whose values are lists of elements. |
|
static
|
set(T... array)
Convert an array into a Set. |
|
static
|
sizeOfListMap(Map<T,List<U>> map)
Get the total number of elements in a map whose values are lists of elements. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> Set<T> set(T... array)
Set.
T - the type of the elements in the array.array - the array to convert.
public static <T> List<T> list(T... array)
List.
T - the type of the elements in the array.array - the array to convert.
public static <T> T[] concatArrays(T[]... arrays)
T - the element type of the arrays to concatenate.arrays - the arrays to concatenate.
public static <T,U> void putInListMap(T key,
U value,
Map<T,List<U>> map)
T - the type of the keys in the map.U - the type of the elements in the lists.key - the key for the value to add.value - the value to add.map - the map in which ot add the key/value pair.
public static <T,U> void removeFromListMap(T key,
U value,
Map<T,List<U>> map)
T - the type of the keys in the map.U - the type of the elements in the lists.key - the key for the value to remove.value - the value to remove.map - the map from which to remove the key/value pair.public static <T,U> int sizeOfListMap(Map<T,List<U>> map)
T - the type of the keys in the map.U - the type of the elements in the lists.map - the map of which to get the size.
public static <T,U> String formatSizeMapInfo(String name,
Map<T,List<U>> map)
T - the type of the keys in the map.U - the type of the values in the map.name - an arbitrary name given to the map.map - the map from which to get size information.
public static <T> List<T> getAllElements(List<T> source,
int start,
int size)
T - the type of the elements in the list.source - the list from which to get the elements.start - the start position in the source list.size - the number of elements to get from the source list.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||