public final class PartialDataset extends SeriesDataset
isOutdated(). In practice the instances can be treated as if they are fully immutable as long as they are
monotonically updated and reading is done from the more recent instances.
When add(long, long)ing points the window is first filled to it capacity. Since the buffers are twice the
window size they start to slide once the size() reaches the capacity(). When the sliding window
reaches the end of the buffer the most recent halve is copied to the first half and sliding starts from there again.
This keeps copying memory only occur every capacity() points.| Modifier and Type | Method and Description |
|---|---|
SeriesDataset |
add(long time,
long value) |
int |
capacity() |
int |
estimatedBytesMemory() |
long |
firstTime() |
long |
getObservedMax() |
long |
getObservedMin() |
BigInteger |
getObservedSum() |
int |
getObservedValueChanges()
Note that minimum is 1 (changing from unknown to know value).
|
int |
getStableCount() |
long |
getStableSince() |
boolean |
isOutdated() |
boolean |
isStable() |
long |
lastTime() |
long |
lastValue() |
long[] |
points()
Example:
|
int |
size() |
long |
time(int index) |
long |
value(int index) |
equals, getInstance, getObservedAvg, getObservedSince, getObservedValues, getSeries, hashCode, isStableZero, perSecond, toStringpublic boolean isOutdated()
isOutdated in class SeriesDatasetpublic long getStableSince()
getStableSince in class SeriesDatasetSeriesDataset.lastValue().public int getStableCount()
getStableCount in class SeriesDatasetSeriesDataset.lastValue()public long getObservedMin()
getObservedMin in class SeriesDatasetLong.MAX_VALUE.public long getObservedMax()
getObservedMax in class SeriesDatasetLong.MIN_VALUE.public BigInteger getObservedSum()
getObservedSum in class SeriesDatasetpublic int getObservedValueChanges()
SeriesDatasetgetObservedValueChanges in class SeriesDatasetpublic int size()
size in class SeriesDatasetpublic int capacity()
capacity in class SeriesDatasetpublic long value(int index)
public long time(int index)
public long lastValue()
lastValue in class SeriesDatasetSeriesDataset.points()public long firstTime()
firstTime in class SeriesDatasetSeriesDataset.points()public long lastTime()
lastTime in class SeriesDatasetSeriesDataset.points()public long[] points()
SeriesDataset[t0, v0, t1, v1, t2, v2]
points in class SeriesDatasetpublic SeriesDataset add(long time, long value)
add in class SeriesDatasetpublic int estimatedBytesMemory()
estimatedBytesMemory in class SeriesDatasetpublic boolean isStable()
isStable in class SeriesDatasetCopyright © 2019. All rights reserved.