@Override public void addBufferChangedListener(IBufferChangedListener listener) { synchronized (lock) { if (!fBufferListeners.contains(listener)) { fBufferListeners.add(listener); } } }
private void fireBufferChanged(BufferChangedEvent event) { IBufferChangedListener[] listeners = null; synchronized (lock) { listeners = fBufferListeners.toArray(new IBufferChangedListener[fBufferListeners.size()]); } for (IBufferChangedListener listener : listeners) { listener.bufferChanged(event); } }
private void fireBufferChanged(BufferChangedEvent event) { if (fBufferListeners != null && fBufferListeners.size() > 0) { Iterator<IBufferChangedListener> e = new ArrayList<IBufferChangedListener>(fBufferListeners).iterator(); while (e.hasNext()) e.next().bufferChanged(event); } }
private void fireBufferChanged(BufferChangedEvent event) { if (fBufferListeners != null && fBufferListeners.size() > 0) { Iterator<IBufferChangedListener> e= new ArrayList<IBufferChangedListener>(fBufferListeners).iterator(); while (e.hasNext()) e.next().bufferChanged(event); } }
@Override public void addBufferChangedListener(IBufferChangedListener listener) {}
@Override public void removeBufferChangedListener(IBufferChangedListener listener) {}
@Override public synchronized void removeBufferChangedListener(IBufferChangedListener listener) { synchronized (lock) { fBufferListeners.remove(listener); } }
public void addBufferChangedListener(IBufferChangedListener listener) { Assert.isNotNull(listener); if (!fBufferListeners.contains(listener)) fBufferListeners.add(listener); }
public void removeBufferChangedListener(IBufferChangedListener listener) { Assert.isNotNull(listener); fBufferListeners.remove(listener); }
public void addBufferChangedListener(IBufferChangedListener listener) {}
public void removeBufferChangedListener(IBufferChangedListener listener) {}