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

Method getAllPresent

output/java_guava/1.4.19/AbstractCache.java:67–81  ·  view source on GitHub ↗

This implementation of getAllPresent lacks any insight into the internal cache data structure, and is thus forced to return the query keys instead of the cached keys. This is only possible with an unsafe cast which requires keys to actually be of type K. {@inheritDoc} @sinc

(Iterable<?> keys)

Source from the content-addressed store, hash-verified

65 */
66
67 @Override
68 public ImmutableMap<K, V> getAllPresent(Iterable<?> keys) {
69 Map<K, V> result = Maps.newLinkedHashMap();
70 for (Object key : keys) {
71 if (!result.containsKey(key)) {
72 @SuppressWarnings("unchecked")
73 K castKey = (K) key;
74 V value = getIfPresent(key);
75 if (value != null) {
76 result.put(castKey, value);
77 }
78 }
79 }
80 return ImmutableMap.copyOf(result);
81 }
82
83 /**
84 * @since 11.0

Callers

nothing calls this directly

Calls 5

newLinkedHashMapMethod · 0.95
copyOfMethod · 0.95
containsKeyMethod · 0.65
getIfPresentMethod · 0.65
putMethod · 0.65

Tested by

no test coverage detected