MCPcopy Index your code
hub / github.com/antlr/codebuff / getAllPresent

Method getAllPresent

output/java_guava/1.4.19/LocalCache.java:4025–4044  ·  view source on GitHub ↗
(Iterable<?> keys)

Source from the content-addressed store, hash-verified

4023 }
4024
4025 ImmutableMap<K, V> getAllPresent(Iterable<?> keys) {
4026 int hits = 0;
4027 int misses = 0;
4028 Map<K, V> result = Maps.newLinkedHashMap();
4029 for (Object key : keys) {
4030 V value = get(key);
4031 if (value == null) {
4032 misses++;
4033 } else {
4034 // TODO(fry): store entry key instead of query key
4035 @SuppressWarnings("unchecked")
4036 K castKey = (K) key;
4037 result.put(castKey, value);
4038 hits++;
4039 }
4040 }
4041 globalStatsCounter.recordHits(hits);
4042 globalStatsCounter.recordMisses(misses);
4043 return ImmutableMap.copyOf(result);
4044 }
4045
4046 ImmutableMap<K, V> getAll(Iterable<? extends K> keys) throws ExecutionException {
4047 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