Observer has subscribed, emits all subsequently observed items to the
subscriber.
Example usage:
PublishSubject<Object> subject = PublishSubject.create();
// observer1 will receive all onNext and onCompleted events
subject.subscribe(observer1);
subject.onNext("one");
subject.onNext("two");
// observer2 will only receive "three" and onCompleted
subject.subscribe(observer2);
subject.onNext("three");
subject.onCompleted();
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final PublishSubject. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static < the value type T> PublishSubject | |
| public Throwable | Returns: the Throwable that terminated the Subject ornull if the
subject hasn't terminated yet or it terminated normally.Returns the Throwable that terminated the Subject. |
| public boolean | Returns: true if the subject completed normally viaonCompletedCheck if the Subject has terminated normally. |
| public boolean | hasObservers()
Implements abstract rx. Subject has Observers subscribed to it.
|
| public boolean | Returns: true if the subject has received a throwable throughonError.Check if the Subject has terminated with an exception. |
| public void | onCompleted()
Implements rx. Observable has finished sending push-based notifications.
|
| public void | onError(Throwable
the exception encountered by the Observable e)Implements rx. Observable has experienced an error condition.
|
| public void | onNext(T
the item emitted by the Observable v)Implements rx. |
| state | back to summary |
|---|---|
| pack-priv final PublishSubject. | |
| PublishSubject | back to summary |
|---|---|
| protected PublishSubject(PublishSubject. | |
| create | back to summary |
|---|---|
| public static <T> PublishSubject Creates and returns a new
| |
| getThrowable | back to summary |
|---|---|
| public Throwable getThrowable() Returns the Throwable that terminated the Subject.
| |
| hasCompleted | back to summary |
|---|---|
| public boolean hasCompleted() Check if the Subject has terminated normally.
| |
| hasObservers | back to summary |
|---|---|
| public boolean hasObservers() Implements abstract rx. Doc from rx. Indicates whether the
| |
| hasThrowable | back to summary |
|---|---|
| public boolean hasThrowable() Check if the Subject has terminated with an exception.
| |
| onCompleted | back to summary |
|---|---|
| public void onCompleted() Implements rx. Doc from rx. Notifies the Observer that the
The
| |
| onError | back to summary |
|---|---|
| public void onError(Throwable e) Implements rx. Doc from rx. Notifies the Observer that the
If the | |
| onNext | back to summary |
|---|---|
| public void onNext(T v) Implements rx. Doc from rx. Provides the Observer with a new item to observe.
The
The
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Subscriber | |
| pack-priv final PublishSubject. | |
| pack-priv long | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isUnsubscribed()
Implements rx. Subscription is currently unsubscribed.
|
| public void | onCompleted()
Implements rx. Observable has finished sending push-based notifications.
|
| public void | onError(Throwable
the exception encountered by the Observable e)Implements rx. Observable has experienced an error condition.
|
| public void | onNext(T
the item emitted by the Observable t)Implements rx. |
| public void | request(long
the maximum number of items you want this Producer to produce, or n)Long.MAX_VALUE if you
want the Producer to produce items at its own paceImplements rx. |
| public void | unsubscribe()
Implements rx. Subscriber that was registered when this Subscription
was received.
|
| actual | back to summary |
|---|---|
| pack-priv final Subscriber<? super T> actual | |
| parent | back to summary |
|---|---|
| pack-priv final PublishSubject. | |
| produced | back to summary |
|---|---|
| pack-priv long produced | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| PublishSubjectProducer | back to summary |
|---|---|
| public PublishSubjectProducer(PublishSubject. | |
| isUnsubscribed | back to summary |
|---|---|
| public boolean isUnsubscribed() Implements rx. Doc from rx. Indicates whether this
| |
| onCompleted | back to summary |
|---|---|
| public void onCompleted() Implements rx. Doc from rx. Notifies the Observer that the
The
| |
| onError | back to summary |
|---|---|
| public void onError(Throwable e) Implements rx. Doc from rx. Notifies the Observer that the
If the | |
| onNext | back to summary |
|---|---|
| public void onNext(T t) Implements rx. Doc from rx. Provides the Observer with a new item to observe.
The
The
| |
| request | back to summary |
|---|---|
| public void request(long n) Implements rx. Doc from rx. Request a certain maximum number of items from this Producer. This is a way of requesting backpressure.
To disable backpressure, pass
Requests are additive but if a sequence of requests totals more than request(100); request(Long.MAX_VALUE-1);
| |
| unsubscribe | back to summary |
|---|---|
| public void unsubscribe() Implements rx. Doc from rx. Stops the receipt of notifications on the
This allows deregistering an
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final PublishSubject. | |
| pack-priv Throwable | |
| private static final long | |
| pack-priv static final PublishSubject. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| public void | |
| public void | onCompleted()
Implements rx. Observable has finished sending push-based notifications.
|
| public void | onError(Throwable
the exception encountered by the Observable e)Implements rx. Observable has experienced an error condition.
|
| public void | onNext(T
the item emitted by the Observable t)Implements rx. |
| pack-priv void |
| EMPTY | back to summary |
|---|---|
pack-priv static final PublishSubject.
| |
| error | back to summary |
|---|---|
| pack-priv Throwable error | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| TERMINATED | back to summary |
|---|---|
pack-priv static final PublishSubject.
| |
| PublishSubjectState | back to summary |
|---|---|
public PublishSubjectState()
| |
| add | back to summary |
|---|---|
| pack-priv boolean add(PublishSubject. | |
| call | back to summary |
|---|---|
| public void call(Subscriber<? super T> t) Implements rx.
| |
| onCompleted | back to summary |
|---|---|
| public void onCompleted() Implements rx. Doc from rx. Notifies the Observer that the
The
| |
| onError | back to summary |
|---|---|
| public void onError(Throwable e) Implements rx. Doc from rx. Notifies the Observer that the
If the
| |
| onNext | back to summary |
|---|---|
| public void onNext(T t) Implements rx. Doc from rx. Provides the Observer with a new item to observe.
The
The
| |
| remove | back to summary |
|---|---|
pack-priv void remove(PublishSubject.
| |