Class ObservableReplay.InnerDisposable<T>

  • Type Parameters:
    T - the value type
    All Implemented Interfaces:
    Disposable, java.io.Serializable
    Enclosing class:
    ObservableReplay<T>

    static final class ObservableReplay.InnerDisposable<T>
    extends java.util.concurrent.atomic.AtomicInteger
    implements Disposable
    A Disposable that manages the disposed state of a child Observer in thread-safe manner.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean cancelled  
      (package private) Observer<? super T> child
      The actual child subscriber.
      (package private) java.lang.Object index
      Holds an object that represents the current location in the buffer.
      (package private) ObservableReplay.ReplayObserver<T> parent
      The parent subscriber-to-source used to allow removing the child in case of child dispose() call.
      private static long serialVersionUID  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Dispose the resource, the operation should be idempotent.
      (package private) <U> U index()
      Convenience method to auto-cast the index object.
      boolean isDisposed()
      Returns true if this resource has been disposed.
      • Methods inherited from class java.util.concurrent.atomic.AtomicInteger

        accumulateAndGet, addAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAcquire, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, getOpaque, getPlain, incrementAndGet, intValue, lazySet, longValue, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
      • Methods inherited from class java.lang.Number

        byteValue, shortValue
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • child

        final Observer<? super T> child
        The actual child subscriber.
      • index

        java.lang.Object index
        Holds an object that represents the current location in the buffer. Guarded by the emitter loop.
      • cancelled

        volatile boolean cancelled
    • Method Detail

      • isDisposed

        public boolean isDisposed()
        Description copied from interface: Disposable
        Returns true if this resource has been disposed.
        Specified by:
        isDisposed in interface Disposable
        Returns:
        true if this resource has been disposed
      • dispose

        public void dispose()
        Description copied from interface: Disposable
        Dispose the resource, the operation should be idempotent.
        Specified by:
        dispose in interface Disposable
      • index

        <U> U index()
        Convenience method to auto-cast the index object.
        Type Parameters:
        U - type index to be casted to
        Returns:
        the index Object or null