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

Method retainAll

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

Source from the content-addressed store, hash-verified

3903 }
3904
3905 @Override
3906 public boolean retainAll(Collection<?> c) {
3907 try {
3908 return super.retainAll(checkNotNull(c));
3909 } catch (UnsupportedOperationException e) {
3910 Set<K> toRetain = Sets.newHashSet();
3911 for (Entry<K, V> entry : map().entrySet()) {
3912 if (c.contains(entry.getValue())) {
3913 toRetain.add(entry.getKey());
3914 }
3915 }
3916 return map().keySet().retainAll(toRetain);
3917 }
3918 }
3919
3920 @Override
3921 public int size() {

Callers

nothing calls this directly

Calls 10

newHashSetMethod · 0.95
mapMethod · 0.95
retainAllMethod · 0.65
entrySetMethod · 0.65
containsMethod · 0.65
getValueMethod · 0.65
addMethod · 0.65
getKeyMethod · 0.65
keySetMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected