import java.util.*; public class EventList { ArrayList list; public EventList() { this.list = new ArrayList(); } public void add(Event event) { for(int i=0; i copy = new ArrayList(this.list); for(int i=copy.size()-1; i>=0; i--) { if(copy.get(i).getFrame() == frame) { this.list.remove(i); } } } public Boolean complete() { return this.list.size() == 0; } public Event next() { Event event = this.list.get(0); this.list.remove(0); return event; } }