public class StandardListenerManager<T> extends Object implements UnaryListenerManager<T>
Modifier and Type | Method and Description |
---|---|
void |
addListener(T listener)
Add the given listener.
|
void |
addListener(T listener,
Executor executor)
Add the given listener.
|
void |
clear()
Remove all listeners
|
void |
forEach(Consumer<T> function)
Utility - apply the given function to each listener.
|
static <T> StandardListenerManager<T> |
mappingStandard(UnaryOperator<T> mapper)
Returns a new mapping container that maps to the same type
|
void |
removeListener(T listener)
Remove the given listener
|
int |
size()
Return the number of listeners
|
static <T> StandardListenerManager<T> |
standard()
Returns a new standard listener container
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isEmpty
public static <T> StandardListenerManager<T> standard()
public static <T> StandardListenerManager<T> mappingStandard(UnaryOperator<T> mapper)
mapper
- listener mapper/wrapperpublic void addListener(T listener)
Listenable
addListener
in interface Listenable<T>
listener
- listener to addpublic void addListener(T listener, Executor executor)
Listenable
addListener
in interface Listenable<T>
listener
- listener to addexecutor
- executor to run listener inpublic void removeListener(T listener)
Listenable
removeListener
in interface Listenable<T>
listener
- listener to removepublic void clear()
ListenerManager
clear
in interface ListenerManager<T,T>
public int size()
ListenerManager
size
in interface ListenerManager<T,T>
public void forEach(Consumer<T> function)
ListenerManager
forEach
in interface ListenerManager<T,T>
function
- function to call for each listenerCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.