/** * Adds a DurationListener to the listener list. * * @param listener Listener to add */ public void addDurationListener(final DurationListener listener) { if (listener == null) { return; } listeners.add(DurationListener.class, listener); }
/** * Fires the duration updated method on all listeners. * * @param newDuration New duration */ protected void fireDurationListener(final int newDuration) { for (DurationListener listener : listeners.get(DurationListener.class)) { listener.durationUpdated(newDuration); } }
/** * Removes a DurationListener from the listener list. * * @param listener Listener to remove */ public void removeDurationListener(final DurationListener listener) { listeners.remove(DurationListener.class, listener); }