public abstract static class Consolidator.AbstractConsolidator extends Object implements Consolidator
Consolidator.AbstractConsolidator, Consolidator.Avg, Consolidator.Max, Consolidator.None| Modifier and Type | Field and Description |
|---|---|
protected int |
multiple
Multiple from primary to consolidated step.
|
protected long |
step
Consolidated step size.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract double |
aggregate(double v1,
double v2)
Combines two values to create an aggregate used as the consolidated value.
|
protected abstract double |
complete(double v)
Performs any final computation on the aggregated value.
|
boolean |
isEmpty()
Returns true if the state is the same as it would be if a new instance of the consolidator
was created.
|
void |
update(long rawTimestamp,
double value)
Update the state with a new primary datapoint.
|
double |
value(long t)
Return the consolidated value for the specified timestamp.
|
protected final long step
protected final int multiple
protected abstract double aggregate(double v1,
double v2)
protected abstract double complete(double v)
public void update(long rawTimestamp,
double value)
Consolidatorupdate in interface ConsolidatorrawTimestamp - Timestamp for the new value.value - Value to include in the consolidated aggregate. If there is no new measurement, then
NaN can be used to force the completion of the consolidated value.public double value(long t)
Consolidatorvalue in interface Consolidatorpublic boolean isEmpty()
ConsolidatorisEmpty in interface Consolidator