TYPE
- the type of the data being passed around.public class DefaultListenable<TYPE> extends java.lang.Object implements Listenable<TYPE>
Constructor and Description |
---|
DefaultListenable() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Listener<TYPE> l)
Add listener for this observable
|
void |
notifyChange(TYPE data)
notify a change in the data.
|
void |
removeListener(Listener<TYPE> l)
Remove listener for this observable
|
public void addListener(Listener<TYPE> l)
Listenable
addListener
in interface Listenable<TYPE>
l
- the listener to addpublic void removeListener(Listener<TYPE> l)
Listenable
removeListener
in interface Listenable<TYPE>
l
- the listener to removepublic void notifyChange(TYPE data)
Listenable
notifyChange
in interface Listenable<TYPE>
data
- an optional value to pass to our listeners.