public class MappingListenerManager<K,V> extends Object implements ListenerManager<K,V>
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(K listener)
Add the given listener.
|
void |
addListener(K listener,
Executor executor)
Add the given listener.
|
void |
clear()
Remove all listeners
|
void |
forEach(Consumer<V> function)
Utility - apply the given function to each listener.
|
static <K,V> ListenerManager<K,V> |
mapping(Function<K,V> mapper)
Returns a new container that wraps listeners using the given mapper
|
void |
removeListener(K listener)
Remove the given listener
|
int |
size()
Return the number of listeners
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisEmptypublic static <K,V> ListenerManager<K,V> mapping(Function<K,V> mapper)
mapper - listener mapper/wrapperpublic void addListener(K listener)
ListenableaddListener in interface Listenable<K>listener - listener to addpublic void addListener(K listener, Executor executor)
ListenableaddListener in interface Listenable<K>listener - listener to addexecutor - executor to run listener inpublic void removeListener(K listener)
ListenableremoveListener in interface Listenable<K>listener - listener to removepublic void clear()
ListenerManagerclear in interface ListenerManager<K,V>public int size()
ListenerManagersize in interface ListenerManager<K,V>public void forEach(Consumer<V> function)
ListenerManagerforEach in interface ListenerManager<K,V>function - function to call for each listenerCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.