@Override public NavigableMap<K, V> subMap( K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) { return filterEntries( unfiltered.subMap(fromKey, fromInclusive, toKey, toInclusive), entryPredicate); }
@Override public NavigableMap<K, V> tailMap(K fromKey, boolean inclusive) { return filterEntries(unfiltered.tailMap(fromKey, inclusive), entryPredicate); } }
@Override public NavigableMap<K, V> descendingMap() { return filterEntries(unfiltered.descendingMap(), entryPredicate); }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { return filterEntries(unfiltered.headMap(toKey, inclusive), entryPredicate); }
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
return filterEntries(unfiltered, Maps.<K>keyPredicateOnEntries(keyPredicate));
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
/** * Returns a bimap containing the mappings in {@code unfiltered} whose keys satisfy a predicate. * The returned bimap is a live view of {@code unfiltered}; changes to one affect the other. * * <p>The resulting bimap's {@code keySet()}, {@code entrySet()}, and {@code values()} views have * iterators that don't support {@code remove()}, but all other methods are supported by the * bimap and its views. When given a key that doesn't satisfy the predicate, the bimap's {@code * put()}, {@code forcePut()} and {@code putAll()} methods throw an {@link * IllegalArgumentException}. * * <p>When methods such as {@code removeAll()} and {@code clear()} are called on the filtered * bimap or its views, only mappings that satisfy the filter will be removed from the underlying * bimap. * * <p>The returned bimap isn't threadsafe or serializable, even if {@code unfiltered} is. * * <p>Many of the filtered bimap's methods, such as {@code size()}, iterate across every key in * the underlying bimap and determine which satisfy the filter. When a live view is <i>not</i> * needed, it may be faster to copy the filtered bimap and use the copy. * * <p><b>Warning:</b> {@code entryPredicate} must be <i>consistent with equals </i>, as * documented at {@link Predicate#apply}. * * @since 14.0 */ public static <K, V> BiMap<K, V> filterKeys( BiMap<K, V> unfiltered, final Predicate<? super K> keyPredicate) { checkNotNull(keyPredicate); return filterEntries(unfiltered, Maps.<K>keyPredicateOnEntries(keyPredicate)); }
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
return filterEntries(unfiltered, Maps.<K>keyPredicateOnEntries(keyPredicate));