public abstract class AbstractConcurrentListenerMultimap<TListener>
extends java.lang.Object
Constructor and Description |
---|
AbstractConcurrentListenerMultimap() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(TListener listener,
ListeningWhitelist whitelist)
Adds a listener to its requested list of packet receivers.
|
protected void |
clearListeners()
Remove all packet listeners.
|
java.util.Collection<PrioritizedListener<TListener>> |
getListener(PacketType type)
Retrieve the registered listeners, in order from the lowest to the highest priority.
|
java.util.Set<PacketType> |
keySet()
Retrieve every registered packet type:
|
java.util.List<PacketType> |
removeListener(TListener listener,
ListeningWhitelist whitelist)
Removes the given listener from the packet event list.
|
java.lang.Iterable<PrioritizedListener<TListener>> |
values()
Retrieve every listener.
|
public void addListener(TListener listener, ListeningWhitelist whitelist)
listener
- - listener with a list of packets to receive notifications for.whitelist
- - the packet whitelist to use.public java.util.List<PacketType> removeListener(TListener listener, ListeningWhitelist whitelist)
listener
- - listener to remove.whitelist
- - the packet whitelist that was used.public java.util.Collection<PrioritizedListener<TListener>> getListener(PacketType type)
The returned list is thread-safe and doesn't require synchronization.
type
- - packet type.public java.lang.Iterable<PrioritizedListener<TListener>> values()
public java.util.Set<PacketType> keySet()
protected void clearListeners()