public abstract static class CastEvent.AbstractCastEventListenerList extends Object implements CastEvent.CastEventListenerList
CastEvent.CastEventListenerList implementation that implements
every method except CastEvent.CastEventListenerList.fire(CastEvent).| Modifier and Type | Field and Description |
|---|---|
protected Map<CastEvent.CastEventListener,Set<CastEvent.CastEventType>> |
filters
The filters that keep track of what
CastEvent.CastEventTypes to send to
which CastEvent.CastEventListeners |
protected Object |
filtersLock
The lock object for the filters
|
protected CopyOnWriteArrayList<CastEvent.CastEventListener> |
listeners
The
List containing the listeners |
protected String |
remoteName
The identifier for the cast device used in logging
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCastEventListenerList(String remoteName)
Abstract constructor that sets the "remote name" final field.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfire@Nonnull protected final String remoteName
protected final CopyOnWriteArrayList<CastEvent.CastEventListener> listeners
List containing the listeners@Nonnull protected final Map<CastEvent.CastEventListener,Set<CastEvent.CastEventType>> filters
CastEvent.CastEventTypes to send to
which CastEvent.CastEventListenersprotected AbstractCastEventListenerList(@Nonnull String remoteName)
remoteName - the identifier for the cast device used in logging.IllegalArgumentException - If remoteName is
null.public boolean add(@Nullable CastEvent.CastEventListener listener, CastEvent.CastEventType... eventTypes)
CastEvent.CastEventListenerListCastEvent.CastEventListener to this
CastEvent.CastEventListenerList for the specified
CastEvent.CastEventTypes.add in interface CastEvent.CastEventListenerListlistener - the CastEvent.CastEventListener to register.eventTypes - the event type(s) to listen to.true if a change was made to the listener list,
false if this registration deadn't lead to any
change.public int addAll(@Nullable Collection<CastEvent.CastEventListener> collection, CastEvent.CastEventType... eventTypes)
CastEvent.CastEventListenerListCastEvent.CastEventListeners to this
CastEvent.CastEventListenerList for the specified
CastEvent.CastEventTypes.addAll in interface CastEvent.CastEventListenerListcollection - the Collection of
CastEvent.CastEventListeners.eventTypes - the CastEvent.CastEventTypes to subscribe to or none
to subscribe to all events.public boolean remove(@Nullable CastEvent.CastEventListener listener)
CastEvent.CastEventListenerListCastEvent.CastEventListener from this
CastEvent.CastEventListenerList.remove in interface CastEvent.CastEventListenerListlistener - the CastEvent.CastEventListener to unregister.true if a change was made to the listener list,
false if this registration deadn't lead to any
change.public boolean removeAll(@Nullable Collection<CastEvent.CastEventListener> collection)
CastEvent.CastEventListenerListCastEvent.CastEventListeners from this
CastEvent.CastEventListenerList.removeAll in interface CastEvent.CastEventListenerListcollection - the Collection of
CastEvent.CastEventListeners.true if a change was made to the listener list,
false if this registration deadn't lead to any
change.public boolean contains(@Nullable CastEvent.CastEventListener listener)
CastEvent.CastEventListenerListCastEvent.CastEventListener is already
registered with this CastEvent.CastEventListenerList.contains in interface CastEvent.CastEventListenerListlistener - the CastEvent.CastEventListener to check.true if the specified CastEvent.CastEventListener is
registered, false otherwise.public void clear()
CastEvent.CastEventListenerListCastEvent.CastEventListeners from this
CastEvent.CastEventListenerList.clear in interface CastEvent.CastEventListenerListpublic boolean isEmpty()
isEmpty in interface CastEvent.CastEventListenerListtrue if this CastEvent.CastEventListenerList has no
registered CastEvent.CastEventListeners, false
otherwise.public int size()
size in interface CastEvent.CastEventListenerListCastEvent.CastEventListeners.public Iterable<CastEvent.CastEventListener> listeners()
listeners in interface CastEvent.CastEventListenerListIterable captured at the
time this method is called.public Iterator<CastEvent.CastEventListener> iterator()
iterator in interface CastEvent.CastEventListenerListIterator captured at the
time this method is called.Copyright © 2022. All rights reserved.