Back to Exoplayer

TimedValueQueue (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/util/TimedValueQueue.html

latest4.3 KB
Original Source

Package com.google.android.exoplayer2.util

Class TimedValueQueue<V>


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classTimedValueQueue\<V\>extends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

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. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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](TimedValueQueue.html "type parameter in TimedValueQueue")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](TimedValueQueue.html "type parameter in TimedValueQueue")pollFirst()

Deprecated.

Removes and returns the first value in the queue, or null if the queue is empty.

- 

pollFloor

@Nullable
public[V](TimedValueQueue.html "type parameter in TimedValueQueue")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](TimedValueQueue.html "type parameter in TimedValueQueue")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)