Package jsl.observers
Class TestObserverableObserver.Observable
- java.lang.Object
-
- jsl.observers.TestObserverableObserver.Observable
-
- All Implemented Interfaces:
ObservableIfc
- Enclosing class:
- TestObserverableObserver
public class TestObserverableObserver.Observable extends java.lang.Object implements ObservableIfc
-
-
Constructor Summary
Constructors Constructor Description Observable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObserver(ObserverIfc observer)
Allows the adding (attaching) of an observer to the observablevoid
changeState()
boolean
contains(ObserverIfc observer)
Returns true if the observer is already attachedint
countObservers()
Returns how many observers are currently observing the observablevoid
deleteObserver(ObserverIfc observer)
Allows the deletion (removing) of an observer from the observablevoid
deleteObservers()
Deletes all the observers from the observable
-
-
-
Method Detail
-
addObserver
public void addObserver(ObserverIfc observer)
Description copied from interface:ObservableIfc
Allows the adding (attaching) of an observer to the observable- Specified by:
addObserver
in interfaceObservableIfc
- Parameters:
observer
- the observer to attach
-
deleteObserver
public void deleteObserver(ObserverIfc observer)
Description copied from interface:ObservableIfc
Allows the deletion (removing) of an observer from the observable- Specified by:
deleteObserver
in interfaceObservableIfc
- Parameters:
observer
- the observer to delete
-
contains
public boolean contains(ObserverIfc observer)
Description copied from interface:ObservableIfc
Returns true if the observer is already attached- Specified by:
contains
in interfaceObservableIfc
- Parameters:
observer
- the observer to check- Returns:
- true if attached
-
deleteObservers
public void deleteObservers()
Description copied from interface:ObservableIfc
Deletes all the observers from the observable- Specified by:
deleteObservers
in interfaceObservableIfc
-
countObservers
public int countObservers()
Description copied from interface:ObservableIfc
Returns how many observers are currently observing the observable- Specified by:
countObservers
in interfaceObservableIfc
- Returns:
- number of observers
-
changeState
public void changeState()
-
-