public final class TimedValueQueue<V> extends Object
| Constructor | Description |
|---|---|
TimedValueQueue() |
|
TimedValueQueue(int initialBufferSize) |
Creates a TimedValueBuffer with the given initial buffer size.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(long timestamp,
V value) |
Associates the specified value with the specified timestamp.
|
void |
clear() |
Removes all of the values.
|
V |
poll(long timestamp) |
Returns the value with the closest timestamp to the given timestamp.
|
V |
pollFirst() |
Removes and returns the first value in the queue, or null if the queue is empty.
|
V |
pollFloor(long timestamp) |
Returns the value with the greatest timestamp which is less than or equal to the given
timestamp.
|
int |
size() |
Returns number of the values buffered.
|
public TimedValueQueue()
public TimedValueQueue(int initialBufferSize)
public void add(long timestamp,
V value)
public void clear()
public int size()
@Nullable public V pollFirst()
@Nullable public V pollFloor(long timestamp)
timestamp - The timestamp value.poll(long)@Nullable public V poll(long timestamp)
timestamp - The timestamp value.pollFloor(long)