MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / iterator

Method iterator

enums/PostOffice.java:52–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 return new Iterable<Mail>() {
51 int n = count;
52 @Override public Iterator<Mail> iterator() {
53 return new Iterator<Mail>() {
54 @Override public boolean hasNext() {
55 return n-- > 0;
56 }
57 @Override public Mail next() {
58 return randomMail();
59 }
60 @Override
61 public void remove() { // Not implemented
62 throw new UnsupportedOperationException();
63 }
64 };
65 }
66 };
67 }
68}

Callers 7

RandomPairClass · 0.45
WasherClass · 0.45
AtUnitExample4Class · 0.45
mainMethod · 0.45
testVersionsMethod · 0.45
entrySetMethod · 0.45
FileInputSupplierMethod · 0.45

Calls

no outgoing calls

Tested by 1

testVersionsMethod · 0.36