| Constructor and Description |
|---|
SlidingTimeWindowArrayReservoir(long window,
java.util.concurrent.TimeUnit windowUnit)
Creates a new
SlidingTimeWindowArrayReservoir with the given window of time. |
SlidingTimeWindowArrayReservoir(long window,
java.util.concurrent.TimeUnit windowUnit,
Clock clock)
Creates a new
SlidingTimeWindowArrayReservoir with the given clock and window of time. |
| Modifier and Type | Method and Description |
|---|---|
Snapshot |
getSnapshot()
Returns a snapshot of the reservoir's values.
|
int |
size()
Returns the number of values recorded.
|
void |
update(long value)
Adds a new recorded value to the reservoir.
|
public SlidingTimeWindowArrayReservoir(long window,
java.util.concurrent.TimeUnit windowUnit)
SlidingTimeWindowArrayReservoir with the given window of time.window - the window of timewindowUnit - the unit of windowpublic SlidingTimeWindowArrayReservoir(long window,
java.util.concurrent.TimeUnit windowUnit,
Clock clock)
SlidingTimeWindowArrayReservoir with the given clock and window of time.window - the window of timewindowUnit - the unit of windowclock - the Clock to usepublic int size()
Reservoirpublic void update(long value)
Reservoirpublic Snapshot getSnapshot()
ReservoirgetSnapshot in interface Reservoir"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"