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