E - the listener object typeT - the type of the object received by the listener in notifyUpdate(String, Object)public abstract class Listenable<E extends Listener,T> extends Object
| Modifier and Type | Field and Description |
|---|---|
private List<E> |
listeners
The list of listeners
|
| Constructor and Description |
|---|
Listenable()
Creates a listenable object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(E listener)
Adds a listener to the object.
|
List<E> |
getListeners()
Returns a list of all the current listeners.
|
protected abstract boolean |
notifyUpdate(String reason,
T arg)
Method called when an update occurs.
|
void |
removeListener(E listener)
Removes a listener from the object.
|
public void addListener(E listener)
listener - to add.public void removeListener(E listener)
listener - to remove.public List<E> getListeners()