/** * Add a new listener and immediately notifies the new * listener by calling its update method. */ public void addListener(NoisyStreamListener listener) { listeners.add(listener); listener.update(this); }
/** * Adds a new listener and immediately notifies the new * listener by calling its update method. */ public void addListener(NoisyStreamListener listener) { listeners.add(listener); listener.update(this); }
/** * Notify all listeners that something changed and they * should check the state of the stream. */ protected void notifyListeners() { Iterator i = listeners.iterator(); while ( i.hasNext() ) { NoisyStreamListener n = (NoisyStreamListener) i.next(); n.update(this); } }
/** * Notify all listeners that something changed and they * should check the state of the stream. */ protected void notifyListeners() { Iterator i = listeners.iterator(); while ( i.hasNext() ) { NoisyStreamListener n = (NoisyStreamListener) i.next(); n.update(this); } }