Home | History | Annotate | Download | only in collect

Lines Matching refs:predicate

22 import com.google.common.base.Predicate;
81 * Returns the elements of {@code unfiltered} that satisfy a predicate. The
89 * predicate is provided. When methods such as {@code removeAll()} and
99 * it may be faster to copy {@code Iterables.filter(unfiltered, predicate)}
103 Collection<E> unfiltered, Predicate<? super E> predicate) {
107 return ((FilteredCollection<E>) unfiltered).createCombined(predicate);
111 checkNotNull(unfiltered), checkNotNull(predicate));
128 final Predicate<? super E> predicate;
131 Predicate<? super E> predicate) {
133 this.predicate = predicate;
136 FilteredCollection<E> createCombined(Predicate<? super E> newPredicate) {
138 Predicates.<E>and(predicate, newPredicate));
143 checkArgument(predicate.apply(element));
149 checkArgument(predicate.apply(element));
155 Iterables.removeIf(unfiltered, predicate);
160 // unsafe cast can result in a CCE from predicate.apply(), which we
164 return predicate.apply(e) && unfiltered.contains(element);
182 return !Iterators.any(unfiltered.iterator(), predicate);
186 return Iterators.filter(unfiltered.iterator(), predicate);
191 // unsafe cast can result in a CCE from predicate.apply(), which we
195 return predicate.apply(e) && unfiltered.remove(element);
205 Predicate<E> combinedPredicate = new Predicate<E>() {
207 return predicate.apply(input) && collection.contains(input);
215 Predicate<E> combinedPredicate = new Predicate<E>() {
217 return predicate.apply(input) && !collection.contains(input);