ArrayList remove = new ArrayList(); Transition t; boolean finished; for (Iterator ii=transitions.iterator(); ii.hasNext();) { t = (Transition) ii.next(); finished = t.step(); if (finished) remove.add(t);
synchronized (lock) { ArrayList remove = new ArrayList(); Transition t; boolean finished; for (Iterator ii=transitions.iterator(); ii.hasNext();) { t = (Transition) ii.next(); finished = t.step(); if (finished) remove.add(t); } for (Iterator rr=remove.iterator(); rr.hasNext();) transitions.remove(rr.next()); if (transitions.size() == 0) { processingTickEvent = false; changes.notifyListeners(change); }
    public void step(int w, int h) {        if (!initialized)            return;        ArrayList remove = new ArrayList();        Transition t;        boolean finished;        for (Iterator ii=transitions.iterator(); ii.hasNext();) {           t = (Transition) ii.next();           finished = t.step();           if (finished)               remove.add(t);        }        for (Iterator rr=remove.iterator(); rr.hasNext();)            transitions.remove(rr.next());        if (transitions.size() == 0) {            processingTickEvent = false;            changes.notifyListeners(change);        }    }