Home | History | Annotate | Download | only in collect

Lines Matching defs:predicate

31 import com.google.common.base.Predicate;
60 * Returns the elements of {@code unfiltered} that satisfy a predicate. The
66 * doesn't satisfy the predicate, the collection's {@code add()} and {@code
78 * it may be faster to copy {@code Iterables.filter(unfiltered, predicate)}
81 * <p><b>Warning:</b> {@code predicate} must be <i>consistent with equals</i>,
82 * as documented at {@link Predicate#apply}. Do not provide a predicate such
90 Collection<E> unfiltered, Predicate<? super E> predicate) {
94 return ((FilteredCollection<E>) unfiltered).createCombined(predicate);
98 checkNotNull(unfiltered), checkNotNull(predicate));
136 final Predicate<? super E> predicate;
139 Predicate<? super E> predicate) {
141 this.predicate = predicate;
144 FilteredCollection<E> createCombined(Predicate<? super E> newPredicate) {
146 Predicates.<E>and(predicate, newPredicate));
152 checkArgument(predicate.apply(element));
159 checkArgument(predicate.apply(element));
166 Iterables.removeIf(unfiltered, predicate);
174 return predicate.apply(e);
186 return !Iterables.any(unfiltered, predicate);
191 return Iterators.filter(unfiltered.iterator(), predicate);
201 return Iterables.removeIf(unfiltered, and(predicate, Predicates.<Object>in(collection)));
206 return Iterables.removeIf(unfiltered, and(predicate, not(Predicates.<Object>in(collection))));