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

Method getAllPresent

corpus/java/training/guava/cache/LocalCache.java:4060–4080  ·  view source on GitHub ↗
(Iterable<?> keys)

Source from the content-addressed store, hash-verified

4058 }
4059
4060 ImmutableMap<K, V> getAllPresent(Iterable<?> keys) {
4061 int hits = 0;
4062 int misses = 0;
4063
4064 Map<K, V> result = Maps.newLinkedHashMap();
4065 for (Object key : keys) {
4066 V value = get(key);
4067 if (value == null) {
4068 misses++;
4069 } else {
4070 // TODO(fry): store entry key instead of query key
4071 @SuppressWarnings("unchecked")
4072 K castKey = (K) key;
4073 result.put(castKey, value);
4074 hits++;
4075 }
4076 }
4077 globalStatsCounter.recordHits(hits);
4078 globalStatsCounter.recordMisses(misses);
4079 return ImmutableMap.copyOf(result);
4080 }
4081
4082 ImmutableMap<K, V> getAll(Iterable<? extends K> keys) throws ExecutionException {
4083 int hits = 0;

Callers

nothing calls this directly

Calls 6

newLinkedHashMapMethod · 0.95
getMethod · 0.95
copyOfMethod · 0.95
putMethod · 0.65
recordHitsMethod · 0.65
recordMissesMethod · 0.65

Tested by

no test coverage detected