T - the type of item the Observer expects to observepublic interfaceObserver<T> After an Observer calls anObservable'ssubscribe method, theObservable calls the Observer'sonNext(T) method to provide notifications. A well-behavedObservable will call an Observer'sonCompleted() method exactly once or the Observer'sonError(java.lang.Throwable) method exactly once.
| Modifier and Type | Method and Description |
|---|---|
void | onCompleted()Notifies the Observer that the Observable has finished sending push-based notifications. |
void | onError(java.lang.Throwable e)Notifies the Observer that the Observable has experienced an error condition. |
void | onNext(T t)Provides the Observer with a new item to observe. |
void onCompleted()
Observable has finished sending push-based notifications. TheObservable will not call this method if it callsonError(java.lang.Throwable).
void onError(java.lang.Throwable e)
Observable has experienced an error condition. If theObservable calls this method, it will not thereafter callonNext(T) oronCompleted().
e - the exception encountered by the Observablevoid onNext(T t)
TheObservable may call this method 0 or more times.
TheObservable will not call this method again after it calls eitheronCompleted() oronError(java.lang.Throwable).
t - the item emitted by the Observable