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

Method run

innerclasses/controller/Controller.java:13–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11 private List<Event> eventList = new ArrayList<>();
12 public void addEvent(Event c) { eventList.add(c); }
13 public void run() {
14 while(eventList.size() > 0)
15 // Make a copy so you're not modifying the list
16 // while you're selecting the elements in it:
17 for(Event e : new ArrayList<>(eventList))
18 if(e.ready()) {
19 System.out.println(e);
20 e.action();
21 eventList.remove(e);
22 }
23 }
24}

Callers

nothing calls this directly

Calls 4

readyMethod · 0.80
actionMethod · 0.65
sizeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected