public class Observable<ObservableType,Event> extends Object
Constructor and Description |
---|
Observable(ObservableType aObservable,
ObserverNotifier<ObservableType,Event> aNotifier)
Constructs the observable.
|
Modifier and Type | Method and Description |
---|---|
int |
getObserverCount()
Gets the number of subscribed observers.
|
void |
send(Event aEvent)
Notifies all subscribed observers.
|
long |
subscribe(Observer<ObservableType,Event> aObserver)
Subscribe an obvers.
|
void |
unsubscribe(long aSubscription)
Unsubscribe an observer.
|
public Observable(ObservableType aObservable, ObserverNotifier<ObservableType,Event> aNotifier)
aObservable
- Observable this instance is used for.aNotifier
- Object used for implementing notification of listeners.public long subscribe(Observer<ObservableType,Event> aObserver)
aObserver
- Observer to subscribe.public void unsubscribe(long aSubscription)
aSubscription
- Subscription which is usedIllegalArgumentException
- In case the subscription is not known.public int getObserverCount()
public void send(Event aEvent)
aEvent
- Event to send.Copyright © 2024. All rights reserved.