MCPcopy
hub / github.com/google/guava / retainAll

Method retainAll

guava/src/com/google/common/collect/Maps.java:4126–4139  ·  view source on GitHub ↗
(Collection<?> c)

Source from the content-addressed store, hash-verified

4124 }
4125
4126 @Override
4127 public boolean retainAll(Collection<?> c) {
4128 try {
4129 return super.retainAll(checkNotNull(c));
4130 } catch (UnsupportedOperationException e) {
4131 Set<K> toRetain = new HashSet<>();
4132 for (Entry<K, V> entry : map().entrySet()) {
4133 if (c.contains(entry.getValue())) {
4134 toRetain.add(entry.getKey());
4135 }
4136 }
4137 return map().keySet().retainAll(toRetain);
4138 }
4139 }
4140
4141 @Override
4142 public int size() {

Callers

nothing calls this directly

Calls 9

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