(Iterable<?> keys)
| 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; |
nothing calls this directly
no test coverage detected