|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.expasy.jpl.commons.collection.CollectionUtils
public class CollectionUtils
Provides static utility method for Collections.
| Constructor Summary | |
|---|---|
CollectionUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
asSet(T... elts)
Create a new instance of HashSet from a list of elements. |
|
static
|
asTreeSet(T... elts)
Create a new instance of TreeSet from a list of elements. |
|
static
|
intersection(Set<T> s1,
Set<T> s2)
Compute the intersection between the 2 given sets. |
|
static
|
minus(Set<T> s1,
Set<T> s2)
Compute s1 - s2. |
|
static List<Double> |
parseDoubleList(String str)
|
|
static List<Integer> |
parseIntList(String str)
|
|
static
|
parseList(String str,
org.apache.commons.collections15.Transformer<String,E> transformer)
Convert a string to a List |
|
static List<String> |
parseStringList(String str)
|
|
static Set<Integer> |
select(Set<Integer> s,
Interval interval)
Keep all integers that belong to the interval. |
|
static Set<Integer> |
select(Set<Integer> s,
int from,
int to)
Keep all integers that belong to the interval. |
|
static
|
union(Set<T>... sets)
Compute the union of many sets. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CollectionUtils()
| Method Detail |
|---|
public static final <T> HashSet<T> asSet(T... elts)
HashSet from a list of elements.
T - the data type.elts - the elements to fill the set.
public static final <T> TreeSet<T> asTreeSet(T... elts)
TreeSet from a list of elements.
T - the data type.elts - the elements to fill the set.
public static final <T> Set<T> intersection(Set<T> s1,
Set<T> s2)
T - the data type.s1 - the first set.s2 - the second set.
public static final <T> Set<T> union(Set<T>... sets)
T - the data type.sets - the sets to merge.
public static final <T> Set<T> minus(Set<T> s1,
Set<T> s2)
T - the data type.s1 - the first set.s2 - the second set.
public static final Set<Integer> select(Set<Integer> s,
int from,
int to)
s - the set to set element from.from - the lower bound of the interval.to - the upper bound.
public static final Set<Integer> select(Set<Integer> s,
Interval interval)
s - the set to set element from.interval - the interval.
public static final <E> List<E> parseList(String str,
org.apache.commons.collections15.Transformer<String,E> transformer)
E - the element type.str - the string to parse list from (format="[?elt1,..,eltn]?").transformer - the converter String to E.
StringConverterspublic static final List<Integer> parseIntList(String str)
public static final List<Double> parseDoubleList(String str)
public static final List<String> parseStringList(String str)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||