public class ConstantDataset extends SeriesDataset
SeriesDataset for Series for only same value was observed so far.
The main advantage over a PartialDataset is the low memory footprint and overall smaller object size for
values that do not change anyway. Should they change the add(long, long) method returns a
PartialDataset.
A minor second advantage is that the observed span can have any length and still be represented with just two points.
So in contrast to a PartialDataset which only has information for a fixed sliding time-frame the constant
nature allows the ConstantDataset to span any time-frame giving the user a more information while using less
resources.
Last but not least the ConstantDataset does not risk to become PartialDataset.isOutdated().| Constructor and Description |
|---|
ConstantDataset(EmptyDataset predecessor,
long time,
long value) |
ConstantDataset(SeriesDataset predecessor,
long time) |
| 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() |
long |
lastTime() |
long |
lastValue() |
long[] |
points()
Example:
|
int |
size() |
equals, getInstance, getObservedAvg, getObservedSince, getObservedValues, getSeries, hashCode, isStable, isStableZero, perSecond, toStringpublic ConstantDataset(SeriesDataset predecessor, long time)
public ConstantDataset(EmptyDataset predecessor, long time, long value)
public long[] points()
SeriesDataset[t0, v0, t1, v1, t2, v2]
points in class SeriesDatasetpublic SeriesDataset add(long time, long value)
add in class SeriesDatasetpublic 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 long getStableSince()
getStableSince in class SeriesDatasetSeriesDataset.lastValue().public int getStableCount()
getStableCount in class SeriesDatasetSeriesDataset.lastValue()public final boolean isOutdated()
isOutdated in class SeriesDatasetpublic final int size()
size in class SeriesDatasetpublic final long firstTime()
firstTime in class SeriesDatasetSeriesDataset.points()public final long lastTime()
lastTime in class SeriesDatasetSeriesDataset.points()public final long lastValue()
lastValue in class SeriesDatasetSeriesDataset.points()public final int capacity()
capacity in class SeriesDatasetpublic int estimatedBytesMemory()
estimatedBytesMemory in class SeriesDatasetCopyright © 2019. All rights reserved.