MCPcopy Create free account
hub / github.com/antlr/codebuff / filterKeys

Method filterKeys

output/java_guava/1.4.18/Maps.java:2282–2286  ·  view source on GitHub ↗

Returns a map containing the mappings in unfiltered whose keys satisfy a predicate. The returned map is a live view of unfiltered; changes to one affect the other. The resulting map's keySet(), entrySet(), and values() views have iterators that don't suppo

(Map<K, V> unfiltered, final Predicate<? super K> keyPredicate)

Source from the content-addressed store, hash-verified

2280
2281
2282 public static <K, V> Map<K, V> filterKeys(Map<K, V> unfiltered, final Predicate<? super K> keyPredicate) {
2283 checkNotNull(keyPredicate);
2284 Predicate<Entry<K, ?>> entryPredicate = keyPredicateOnEntries(keyPredicate);
2285 return (unfiltered instanceof AbstractFilteredMap) ? filterFiltered((AbstractFilteredMap<K, V>) unfiltered, entryPredicate) : new FilteredKeyMap<K, V>(checkNotNull(unfiltered), keyPredicate, entryPredicate);
2286 }
2287
2288 /**
2289 * Returns a sorted map containing the mappings in {@code unfiltered} whose

Callers 1

createAsMapMethod · 0.95

Calls 4

keyPredicateOnEntriesMethod · 0.95
filterFilteredMethod · 0.95
filterEntriesMethod · 0.95
checkNotNullMethod · 0.45

Tested by

no test coverage detected