Interface ReplaySubject.ReplayBuffer<T>

Type Parameters:
T - the value type
All Known Implementing Classes:
ReplaySubject.SizeAndTimeBoundReplayBuffer, ReplaySubject.SizeBoundReplayBuffer, ReplaySubject.UnboundedReplayBuffer
Enclosing class:
ReplaySubject<T>

static interface ReplaySubject.ReplayBuffer<T>
Abstraction over a buffer that receives events and replays them to individual Observers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(T value)
     
    void
    addFinal(Object notificationLite)
     
    boolean
    compareAndSet(Object expected, Object next)
    Atomically compares and sets the next terminal NotificationLite object if the current equals to the expected NotificationLite object.
    get()
    Returns the terminal NotificationLite object or null if not yet terminated.
     
    T[]
    getValues(T[] array)
     
    void
     
    int
     
    void
    Make sure an old inaccessible head value is released in a bounded buffer.
  • Method Details

    • add

      void add(T value)
    • addFinal

      void addFinal(Object notificationLite)
    • replay

    • size

      int size()
    • getValue

      @Nullable T getValue()
    • getValues

      T[] getValues(T[] array)
    • get

      Object get()
      Returns the terminal NotificationLite object or null if not yet terminated.
      Returns:
      the terminal NotificationLite object or null if not yet terminated
    • compareAndSet

      boolean compareAndSet(Object expected, Object next)
      Atomically compares and sets the next terminal NotificationLite object if the current equals to the expected NotificationLite object.
      Parameters:
      expected - the expected NotificationLite object
      next - the next NotificationLite object
      Returns:
      true if successful
    • trimHead

      void trimHead()
      Make sure an old inaccessible head value is released in a bounded buffer.