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

Method retainAll

output/java_guava/1.4.18/Maps.java:3901–3914  ·  view source on GitHub ↗
(Collection<?> c)

Source from the content-addressed store, hash-verified

3899 }
3900
3901 @Override
3902 public boolean retainAll(Collection<?> c) {
3903 try {
3904 return super.retainAll(checkNotNull(c));
3905 } catch (UnsupportedOperationException e) {
3906 Set<K> toRetain = Sets.newHashSet();
3907 for (Entry<K, V> entry : map().entrySet()) {
3908 if (c.contains(entry.getValue())) {
3909 toRetain.add(entry.getKey());
3910 }
3911 }
3912 return map().keySet().retainAll(toRetain);
3913 }
3914 }
3915
3916 @Override
3917 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