public abstract class Interpolator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Interpolator.AnalogInterpolator
For analog tags, the value is ramps directly between the values
|
protected static class |
Interpolator.DiscreteInterpolator
For discrete tags, the value is flat until it then changes, at the timestamp of B
|
Constructor and Description |
---|
Interpolator() |
Modifier and Type | Method and Description |
---|---|
static Interpolator |
createAnalogInterpolator() |
static Interpolator |
createDiscreteInterpolator() |
ProcessedValue |
getValueAt(long timestamp)
Returns the (potentially) interpolated value at the time.
|
protected abstract ProcessedValue |
interpolate(long timestamp)
"A" or "B" can be null, but the situation will be A |
protected ProcessedValue |
interpolateDiscrete(long timestamp) |
protected ProcessedValue |
interpolateLinear(long timestamp) |
protected abstract boolean |
needsDoubles() |
void |
update(HistoricalValue value)
Adds the value to the interpolator.
|
protected ProcessedValue |
valueFor(java.lang.Object value,
DataQuality qual,
long ts,
boolean provisional)
Returns interpolated processed value.
|
protected ProcessedValue |
valueFor(java.lang.Object value,
DataQuality qual,
long ts,
boolean provisional,
boolean interpolated) |
public static Interpolator createDiscreteInterpolator()
public static Interpolator createAnalogInterpolator()
public void update(HistoricalValue value) throws java.lang.IllegalArgumentException
value
- java.lang.IllegalArgumentException
- if the incoming value has a timestamp less than a previously added value.public ProcessedValue getValueAt(long timestamp) throws java.lang.IllegalArgumentException
timestamp
- java.lang.IllegalArgumentException
- if the time requested is before a previously requested time. All requests must go forward.protected ProcessedValue valueFor(java.lang.Object value, DataQuality qual, long ts, boolean provisional)
protected ProcessedValue valueFor(java.lang.Object value, DataQuality qual, long ts, boolean provisional, boolean interpolated)
protected abstract boolean needsDoubles()
protected abstract ProcessedValue interpolate(long timestamp)
protected ProcessedValue interpolateDiscrete(long timestamp)
protected ProcessedValue interpolateLinear(long timestamp)