Home | History | Annotate | Download | only in util

Lines Matching refs:predicate

23  * {@code Predicate} objects.
31 * Returns a Predicate that evaluates to true iff each of its components
35 public static <T> Predicate<T> and(Predicate<? super T>... components) {
40 * Returns a Predicate that evaluates to true iff each of its components
44 * the behavior of this Predicate. If components is empty, the returned
45 * Predicate will always evaluate to true.
47 public static <T> Predicate<T> and(Iterable<? extends Predicate<? super T>> components) {
52 * Returns a Predicate that evaluates to true iff any one of its components
56 public static <T> Predicate<T> or(Predicate<? super T>... components) {
61 * Returns a Predicate that evaluates to true iff any one of its components
65 * the behavior of this Predicate. If components is empty, the returned
66 * Predicate will always evaluate to false.
68 public static <T> Predicate<T> or(Iterable<? extends Predicate<? super T>> components) {
73 * Returns a Predicate that evaluates to true iff the given Predicate
76 public static <T> Predicate<T> not(Predicate<? super T> predicate) {
77 return new NotPredicate<T>(predicate);
80 private static class AndPredicate<T> implements Predicate<T> {
81 private final Iterable<? extends Predicate<? super T>> components;
83 private AndPredicate(Iterable<? extends Predicate<? super T>> components) {
88 for (Predicate<? super T> predicate : components) {
89 if (!predicate.apply(t)) {
97 private static class OrPredicate<T> implements Predicate<T> {
98 private final Iterable<? extends Predicate<? super T>> components;
100 private OrPredicate(Iterable<? extends Predicate<? super T>> components) {
105 for (Predicate<? super T> predicate : components) {
106 if (predicate.apply(t)) {
114 private static class NotPredicate<T> implements Predicate<T> {
115 private final Predicate<? super T> predicate;
117 private NotPredicate(Predicate<? super T> predicate) {
118 this.predicate = predicate;
122 return !predicate.apply(t);