public final class TimedValueQueue<V>
extends java.lang.Object
| Constructor and Description |
|---|
TimedValueQueue() |
TimedValueQueue(int initialBufferSize)
Creates a TimedValueBuffer with the given initial buffer size.
|
| Modifier and Type | Method and 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 |
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 pollFloor(long timestamp)
timestamp - The timestamp value.poll(long)@Nullable public V poll(long timestamp)
timestamp - The timestamp value.pollFloor(long)