|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.util.CollectionHelper
public class CollectionHelper
A collection of static methods to help with using java.util.Collection derivates.
This is an addition to Collections
.
Constructor Summary | |
---|---|
CollectionHelper()
|
Method Summary | ||
---|---|---|
static
|
copySelective(java.util.Collection<? extends T> source,
java.util.Collection<? super T> target,
Predicate<T> filter)
Copies all elements that match a predicate. |
|
static
|
selectAsList(java.util.Collection<? extends T> source,
Predicate<T> filter)
Retrieves all elements from a collection that match a predicate. |
|
static
|
selectFirst(java.util.Collection<? extends T> source,
Predicate<T> filter)
Retrieves the first element from a collection that matches a predicate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionHelper()
Method Detail |
---|
public static <T> void copySelective(java.util.Collection<? extends T> source, java.util.Collection<? super T> target, Predicate<T> filter)
public static <T> java.util.List<T> selectAsList(java.util.Collection<? extends T> source, Predicate<T> filter)
T
- The type of elements we are interested in.source
- A collection containing elements we are interested in. Not null. Can be empty.filter
- The predicate determining if an element is to be retrieved. Not null.
public static <T> T selectFirst(java.util.Collection<? extends T> source, Predicate<T> filter)
T
- The type of elements we are interested in.source
- A collection containing elements we are interested in. Not null. Can be empty.filter
- The predicate determining if an element is to be retrieved. Not null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |