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

Method retainAll

output/java_guava/1.4.19/Maps.java:3990–4005  ·  view source on GitHub ↗
(Collection<?> c)

Source from the content-addressed store, hash-verified

3988 }
3989
3990 @Override
3991 public boolean retainAll(Collection<?> c) {
3992 try {
3993 return super.retainAll(checkNotNull(c));
3994 } catch (UnsupportedOperationException e) {
3995 // if the iterators don't support remove
3996 Set<Object> keys = Sets.newHashSetWithExpectedSize(c.size());
3997 for (Object o : c) {
3998 if (contains(o)) {
3999 Entry<?, ?> entry = (Entry<?, ?>) o;
4000 keys.add(entry.getKey());
4001 }
4002 }
4003 return map().keySet().retainAll(keys);
4004 }
4005 }
4006 }
4007
4008 @GwtIncompatible // NavigableMap

Callers

nothing calls this directly

Calls 9

containsMethod · 0.95
mapMethod · 0.95
retainAllMethod · 0.65
sizeMethod · 0.65
addMethod · 0.65
getKeyMethod · 0.65
keySetMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected