MCPcopy Create free account
hub / github.com/cschanck/single-file-java / entries

Method entries

src/main/java/org/sfj/ChiseledMap.java:398–417  ·  view source on GitHub ↗

Entry iterator. Necessary slushy with respect to concurrency. @return iterator of entries.

()

Source from the content-addressed store, hash-verified

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() {

Callers 2

iteratorMethod · 0.95
snapshotMethod · 0.95

Calls 2

iteratorMethod · 0.45
entrySetMethod · 0.45

Tested by

no test coverage detected