Home | History | Annotate | Download | only in collect

Lines Matching defs:predicate

27 import com.google.common.base.Predicate;
240 * Returns a view of the elements of {@code unfiltered} that satisfy a predicate. The returned
246 * that doesn't satisfy the predicate, the multiset's {@code add()} and {@code addAll()} methods
258 * <p><b>Warning:</b> {@code predicate} must be <i>consistent with equals</i>, as documented at
259 * {@link Predicate#apply}. Do not provide a predicate such as
266 public static <E> Multiset<E> filter(Multiset<E> unfiltered, Predicate<? super E> predicate) {
271 Predicate<E> combinedPredicate
272 = Predicates.<E>and(filtered.predicate, predicate);
275 return new FilteredMultiset<E>(unfiltered, predicate);
280 final Predicate<? super E> predicate;
282 FilteredMultiset(Multiset<E> unfiltered, Predicate<? super E> predicate) {
284 this.predicate = checkNotNull(predicate);
289 return Iterators.filter(unfiltered.iterator(), predicate);
294 return Sets.filter(unfiltered.elementSet(), predicate);
299 return Sets.filter(unfiltered.entrySet(), new Predicate<Entry<E>>() {
302 return predicate.apply(entry.getElement());
323 return predicate.apply(e) ? count : 0;
330 checkArgument(predicate.apply(element),
331 "Element %s does not match predicate %s", element, predicate);