Methods Summary |
---|
public void | attach(Observer observer)Attach an observer to this object.
mObservers.add(observer);
|
public void | detach(Observer observer)Detach an observer from this object.
if (mIterator != null) {
mIterator.remove();
} else {
mObservers.remove(observer);
}
|
public abstract TransactionState | getState()This method is implemented by the observable to represent its
current state.
|
public void | notifyObservers()Notify all observers that a status change has occurred.
mIterator = mObservers.iterator();
try {
while (mIterator.hasNext()) {
mIterator.next().update(this);
}
} finally {
mIterator = null;
}
|