ListIterator i = list.listIterator(); while (i.hasNext()) { AgentEventListener listener = (AgentEventListener) i.next(); if (e.getSource() != listener) listener.eventFired(e); }
if (list != null) { ListIterator i = list.listIterator(); while (i.hasNext()) { AgentEventListener listener = (AgentEventListener) i.next(); if (e.getSource() != listener) listener.eventFired(e); } }
    private void dispatch()    {        // grab the first event posted        AgentEvent e = (AgentEvent) eventQueue.removeLast();        Class eventClass = e.getClass();        LinkedList list = (LinkedList) deMultiplexTable.get(eventClass);        ListIterator i = list.listIterator();        while (i.hasNext()) {            AgentEventListener listener = (AgentEventListener) i.next();            if (e.getSource() != listener) listener.eventFired(e);        }       }