public abstract class Predicate<T> extends Object
Object
s.Modifier and Type | Field and Description |
---|---|
static Predicate |
FALSE |
static Predicate |
TRUE |
Constructor and Description |
---|
Predicate() |
Modifier and Type | Method and Description |
---|---|
Predicate<T> |
and(Predicate<T> conjunct)
Return a predicate that is a conjunction of this predicate and another predicate
|
static <T> Predicate<T> |
falsePred() |
static <T> List<T> |
filter(Iterator<T> src,
Predicate<T> pred)
Filter a collection: generate a new list from an existing collection, consisting of the elements satisfying some predicate.
|
static <T> Predicate<T> |
isElementOf(Collection<T> c)
Create the predicate "is an element of c"
|
Predicate<T> |
not()
Return a predicate that is a negation of this predicate
|
Predicate<T> |
or(Predicate<T> disjunct)
Return a predicate that is a conjunction of this predicate and another predicate
|
abstract boolean |
test(T t)
|
static <T> Predicate<T> |
truePred() |
public static <T> Predicate<T> truePred()
public static <T> Predicate<T> falsePred()
public abstract boolean test(T t)
public Predicate<T> and(Predicate<T> conjunct)
public Predicate<T> or(Predicate<T> disjunct)
public static <T> Predicate<T> isElementOf(Collection<T> c)
public static <T> List<T> filter(Iterator<T> src, Predicate<T> pred) throws IllegalArgumentException
IllegalArgumentException
- if src == null