| Modifier and Type | Field and Description |
|---|---|
| pack-priv final AtomicReference |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SerialDisposable(Disposable
the initial Disposable instance to use, null allowed initialDisposable)Constructs a SerialDisposable with the given initial Disposable instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Implements io. |
| public Disposable | Returns: the current Disposable, may be nullReturns the currently contained Disposable or null if this container is empty. |
| public boolean | isDisposed()
Implements io. |
| public boolean | Returns: true if the operation succeeded, false if the container has been disposedthe Disposable to set, may be null next)Atomically: set the next disposable on this container but don't dispose the previous one (if any) or dispose next if the container has been disposed. |
| public boolean | Returns: true if the operation succeeded, false if the container has been disposedthe Disposable to set, may be null next)Atomically: set the next disposable on this container and dispose the previous one (if any) or dispose next if the container has been disposed. |
| resource | back to summary |
|---|---|
| pack-priv final AtomicReference<Disposable> resource | |
| SerialDisposable | back to summary |
|---|---|
| public SerialDisposable() Constructs an empty SerialDisposable. | |
| SerialDisposable | back to summary |
|---|---|
| public SerialDisposable(Disposable initialDisposable) Constructs a SerialDisposable with the given initial Disposable instance.
| |
| dispose | back to summary |
|---|---|
| public void dispose() Implements io. Doc from io. Dispose the resource, the operation should be idempotent.
| |
| get | back to summary |
|---|---|
| public Disposable get() Returns the currently contained Disposable or null if this container is empty.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Implements io. Doc from io. Returns true if this resource has been disposed.
| |
| replace | back to summary |
|---|---|
| public boolean replace(Disposable next) Atomically: set the next disposable on this container but don't dispose the previous one (if any) or dispose next if the container has been disposed.
| |
| set | back to summary |
|---|---|
| public boolean set(Disposable next) Atomically: set the next disposable on this container and dispose the previous one (if any) or dispose next if the container has been disposed.
| |