|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvitro.util.Groups
public class Groups
Groups provides a set of utility methods for filtering and manipulating collections.
Constructor Summary | |
---|---|
Groups()
|
Method Summary | ||
---|---|---|
static
|
any(Collection<S> source)
Extract a random element from a Collection. |
|
static
|
containsType(Class<C> c,
Collection<S> source)
Check a Collection for elements with a given class. |
|
static
|
first(Collection<S> source)
Extract the first element from a Collection. |
|
static
|
firstOfType(Class<C> c,
Collection<S> source)
Extract an element from a Collection with a given class. |
|
static
|
ofType(Class<C> c,
Collection<S> source)
Extract elements from a Collection with a given class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Groups()
Method Detail |
---|
public static <S,C extends S> S firstOfType(Class<C> c, Collection<S> source)
c
- the desired Class.source
- the Collection to filter.
public static <S,C extends S> List<S> ofType(Class<C> c, Collection<S> source)
c
- the desired Class.source
- the Collection to filter.
public static <S,C extends S> boolean containsType(Class<C> c, Collection<S> source)
c
- the desired Class.source
- the Collection to examine.
public static <S> S any(Collection<S> source)
source
- the Collection to filter.
public static <S> S first(Collection<S> source)
source
- the Collection to filter.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |