public class Observable extends Object
| Constructor and Description |
|---|
Observable()
Constructs a new Observable instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addObserver(Observer o)
Adds an observer instance if it is not already in the
set of observers for this Observable.
|
int |
getObserverCount()
Gets observer count.
|
void |
notifyObservers(Object arg)
Notifies all observer instances in the set of observers
of this Observable.
|
void |
removeObserver(Observer o)
Removes an observer instance from the set of observers
of this Observable.
|
void |
removeObservers()
Removes all observer instances from the set of observers
of this Observable.
|
public int getObserverCount()
public void addObserver(Observer o)
o - an observer instance to be added.public void removeObserver(Observer o)
o - an observer instance to be removed.public void removeObservers()
public void notifyObservers(Object arg)
arg - an arbitrary argument to be passed.Copyright © 2017. All rights reserved.