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

Method getAllPresent

output/java_guava/1.4.13/LocalCache.java:4008–4027  ·  view source on GitHub ↗
(Iterable<?> keys)

Source from the content-addressed store, hash-verified

4006 }
4007
4008 ImmutableMap<K, V> getAllPresent(Iterable<?> keys) {
4009 int hits = 0;
4010 int misses = 0;
4011 Map<K, V> result = Maps.newLinkedHashMap();
4012 for (Object key : keys) {
4013 V value = get(key);
4014 if (value == null) {
4015 misses++;
4016 } else {
4017 // TODO(fry): store entry key instead of query key
4018 @SuppressWarnings("unchecked")
4019 K castKey = (K) key;
4020 result.put(castKey, value);
4021 hits++;
4022 }
4023 }
4024 globalStatsCounter.recordHits(hits);
4025 globalStatsCounter.recordMisses(misses);
4026 return ImmutableMap.copyOf(result);
4027 }
4028
4029 ImmutableMap<K, V> getAll(Iterable<? extends K> keys) throws ExecutionException {
4030 int hits = 0;

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected