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

Method getAllPresent

guava/src/com/google/common/cache/LocalCache.java:4009–4029  ·  guava/src/com/google/common/cache/LocalCache.java::LocalCache.getAllPresent
(Iterable<?> keys)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

builderMethod · 0.95
getMethod · 0.95
putMethod · 0.65
recordHitsMethod · 0.65
recordMissesMethod · 0.65
buildKeepingLastMethod · 0.45

Tested by

no test coverage detected