public class DerbyObservable
extends java.lang.Object
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 |
_hasChanged |
private java.util.ArrayList<DerbyObserver> |
_observers |
Constructor and Description |
---|
DerbyObservable()
No-arg constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addObserver(DerbyObserver observer)
Add another observer who wants to be told about changes to this object.
|
int |
countObservers()
Return the number of observers who are watching this object.
|
void |
deleteObserver(DerbyObserver observer)
Remove a specific observer from the list of watchers.
|
void |
notifyObservers()
This method is equivalent to notifyObservers(null);
|
void |
notifyObservers(java.lang.Object extraInfo)
If this object has changed, then notify all observers.
|
protected void |
setChanged()
When the object state changes, the object calls this method
in order to flag that fact.
|
private boolean _hasChanged
private java.util.ArrayList<DerbyObserver> _observers
public void addObserver(DerbyObserver observer)
observer
- The object which wants to be notified when this object changesjava.lang.IllegalArgumentException
- If the argument is bad (e.g., null)public int countObservers()
public void deleteObserver(DerbyObserver observer)
observer
- The observer to remove.public void notifyObservers()
public void notifyObservers(java.lang.Object extraInfo)
extraInfo
- Extra information to be passed to the observer's callback method.protected void setChanged()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.