Created to provide the Observable behavior which Derby has depended on since Java 1.2 but which as deprecated in JDK 9 build 118. A DerbyObservable is an object whose state changes are being tracked.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private ArrayList |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | addObserver(DerbyObserver
The object which wants to be notified when this object changes observer)Add another observer who wants to be told about changes to this object. |
| public synchronized int | Returns: The number of watchersReturn the number of observers who are watching this object. |
| public synchronized void | deleteObserver(DerbyObserver
The observer to remove. observer)Remove a specific observer from the list of watchers. |
| public void | |
| public void | notifyObservers(Object
Extra information to be passed to the observer's callback method. extraInfo)If this object has changed, then notify all observers. |
| protected synchronized void |
| _hasChanged | back to summary |
|---|---|
| private boolean _hasChanged | |
| _observers | back to summary |
|---|---|
| private ArrayList<DerbyObserver> _observers | |
| DerbyObservable | back to summary |
|---|---|
| public DerbyObservable() No-arg constructor | |
| addObserver | back to summary |
|---|---|
| public synchronized void addObserver(DerbyObserver observer) Add another observer who wants to be told about changes to this object.
| |
| countObservers | back to summary |
|---|---|
| public synchronized int countObservers() Return the number of observers who are watching this object.
| |
| deleteObserver | back to summary |
|---|---|
| public synchronized void deleteObserver(DerbyObserver observer) Remove a specific observer from the list of watchers. Null is ignored.
| |
| notifyObservers | back to summary |
|---|---|
| public void notifyObservers() This method is equivalent to notifyObservers(null); | |
| notifyObservers | back to summary |
|---|---|
| public void notifyObservers(Object extraInfo) If this object has changed, then notify all observers. Pass them this object and the extraInfo. This object is then marked as unchanged again.
| |
| setChanged | back to summary |
|---|---|
| protected synchronized void setChanged() When the object state changes, the object calls this method in order to flag that fact. After this method has been called, then the notifyObservers() will wake up the observers which are watching this object. | |