Entry iterator. Necessary slushy with respect to concurrency. @return iterator of entries.
()
| 396 | * @return iterator of entries. |
| 397 | */ |
| 398 | public Iterable<Entry<K, V>> entries() { |
| 399 | return () -> new Iterator<Entry<K, V>>() { |
| 400 | final Iterator<Entry<K, Long>> base = map.entrySet().iterator(); |
| 401 | |
| 402 | @Override |
| 403 | public boolean hasNext() { |
| 404 | return base.hasNext(); |
| 405 | } |
| 406 | |
| 407 | @Override |
| 408 | public Entry<K, V> next() { |
| 409 | Entry<K, Long> n = base.next(); |
| 410 | try { |
| 411 | return fetch(n.getValue(), false, null); |
| 412 | } catch (IOException e) { |
| 413 | throw new RuntimeIOException(e); |
| 414 | } |
| 415 | } |
| 416 | }; |
| 417 | } |
| 418 | |
| 419 | @Override |
| 420 | public Set<Entry<K, V>> entrySet() { |