Observable<T> Class
- java.
lang. Object - system.
fabric. Observable<T>
- system.
Type Parameters
- T
Takes a template parameter T.
public class Observable
This class represents an observable object
Constructor Summary
Constructor | Description |
---|---|
Observable() |
Instantiates an system.fabric.Observable object. |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
addObserver(Observer<? super T> observer)
Adds an observer to the set of observers for this object. |
void |
clearObservers()
Removes all the observers of this class. |
int |
countObservers()
Number of observers of this object. |
List<Observer<? super T>> |
getAllObservers()
Lists all the observers of this object. |
void |
notifyObservers(final Object sender)
Notify all of its observers |
void |
notifyObservers(final Object sender, final T value)
Notify all of its observers |
void |
removeObserver(Observer<? super T> observable)
Removes an observer from the set of observers of this object. |
Constructor Details
Observable
public Observable()
Instantiates an system.fabric.Observable object.
Method Details
addObserver
public void addObserver(Observer observer)
Adds an observer to the set of observers for this object.
Parameters:
clearObservers
public void clearObservers()
Removes all the observers of this class.
countObservers
public int countObservers()
Number of observers of this object.
Returns:
getAllObservers
public List
Lists all the observers of this object.
Returns:
notifyObservers
public void notifyObservers(final Object sender)
Notify all of its observers
Parameters:
notifyObservers
public void notifyObservers(final Object sender, final T value)
Notify all of its observers
Parameters:
removeObserver
public void removeObserver(Observer observable)
Removes an observer from the set of observers of this object.
Parameters:
Observer<U> object as parameter.