| 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,
JsonObject json)
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()
protected abstract boolean notifyUpdate(String reason, JsonObject json)
reason - for notifying the model.json - object of the updated model.