Listenable<T>public class ListenerContainer<T> extends java.lang.Object implements Listenable<T>
| Constructor | Description |
|---|---|
ListenerContainer() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addListener(T listener) |
Add the given listener.
|
void |
addListener(T listener,
java.util.concurrent.Executor executor) |
Add the given listener.
|
void |
clear() |
Remove all listeners
|
void |
forEach(com.google.common.base.Function<T,java.lang.Void> function) |
Utility - apply the given function to each listener.
|
void |
removeListener(T listener) |
Remove the given listener
|
int |
size() |
Return the number of listeners
|
public void addListener(T listener)
ListenableaddListener in interface Listenable<T>listener - listener to addpublic void addListener(T listener, java.util.concurrent.Executor executor)
ListenableaddListener in interface Listenable<T>listener - listener to addexecutor - executor to run listener inpublic void removeListener(T listener)
ListenableremoveListener in interface Listenable<T>listener - listener to removepublic void clear()
public int size()
public void forEach(com.google.common.base.Function<T,java.lang.Void> function)
function - function to call for each listenerCopyright © 2011–2018 The Apache Software Foundation. All rights reserved.