Class TimedValueQueue<V>


  • @Deprecated
    public final class TimedValueQueue<V>
    extends Object
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    A utility class to keep a queue of values with timestamps. This class is thread safe.
    • Constructor Summary

      Constructors 
      Constructor Description
      TimedValueQueue()
      Deprecated.
       
      TimedValueQueue​(int initialBufferSize)
      Deprecated.
      Creates a TimedValueBuffer with the given initial buffer size.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void add​(long timestamp, V value)
      Deprecated.
      Associates the specified value with the specified timestamp.
      void clear()
      Deprecated.
      Removes all of the values.
      V poll​(long timestamp)
      Deprecated.
      Returns the value with the closest timestamp to the given timestamp.
      V pollFirst()
      Deprecated.
      Removes and returns the first value in the queue, or null if the queue is empty.
      V pollFloor​(long timestamp)
      Deprecated.
      Returns the value with the greatest timestamp which is less than or equal to the given timestamp.
      int size()
      Deprecated.
      Returns number of the values buffered.
    • Constructor Detail

      • TimedValueQueue

        public TimedValueQueue()
        Deprecated.
      • TimedValueQueue

        public TimedValueQueue​(int initialBufferSize)
        Deprecated.
        Creates a TimedValueBuffer with the given initial buffer size.
    • Method Detail

      • add

        public void add​(long timestamp,
                        V value)
        Deprecated.
        Associates the specified value with the specified timestamp. All new values should have a greater timestamp than the previously added values. Otherwise all values are removed before adding the new one.
      • clear

        public void clear()
        Deprecated.
        Removes all of the values.
      • size

        public int size()
        Deprecated.
        Returns number of the values buffered.
      • pollFirst

        @Nullable
        public V pollFirst()
        Deprecated.
        Removes and returns the first value in the queue, or null if the queue is empty.
      • pollFloor

        @Nullable
        public V pollFloor​(long timestamp)
        Deprecated.
        Returns the value with the greatest timestamp which is less than or equal to the given timestamp. Removes all older values and the returned one from the buffer.
        Parameters:
        timestamp - The timestamp value.
        Returns:
        The value with the greatest timestamp which is less than or equal to the given timestamp or null if there is no such value.
        See Also:
        poll(long)
      • poll

        @Nullable
        public V poll​(long timestamp)
        Deprecated.
        Returns the value with the closest timestamp to the given timestamp. Removes all older values including the returned one from the buffer.
        Parameters:
        timestamp - The timestamp value.
        Returns:
        The value with the closest timestamp or null if the buffer is empty.
        See Also:
        pollFloor(long)