public abstract class TimeSeriesProcessor<T>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T>> |
data |
| Constructor and Description |
|---|
TimeSeriesProcessor()
Initializes a new instance of the
TimeSeriesProcessor class with the provided TimeSeriesBinding. |
| Modifier and Type | Method and Description |
|---|---|
void |
addSample(javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T> sample)
Adds a new sample to the processor's data store
|
protected abstract T |
computeAverageValue() |
protected abstract T |
computeMaxValue() |
protected abstract T |
computeMinValue() |
T |
getAverageValue()
Gets the average for all Y coordinates of the
TimeSeriesProcessor |
java.util.Collection<javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T>> |
getData()
Gets the data of the
TimeSeriesProcessor |
T |
getMaxValue()
Gets the maximum value for the Y coordinates of the
TimeSeriesProcessor |
T |
getMinValue()
Gets the minimum value for the Y coordinates of the
TimeSeriesProcessor |
T |
getNearestValue(java.time.ZonedDateTime xValue)
Get the nearest value for the specified time stamp.
|
javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T> |
getSample(int index)
Returns the data sample at the given index.
|
void |
setData(java.util.Collection<javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T>> newData)
Sets the content for the
TimeSeriesProcessor's data store |
int |
size()
Returns the number of elements in the processor's data store
|
java.util.Optional<T> |
tryGetNearestValue(java.time.ZonedDateTime xValue)
Try to get the nearest value for the specified time stamp.
|
protected java.util.List<javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T>> data
public TimeSeriesProcessor()
TimeSeriesProcessor class with the provided TimeSeriesBinding.public final T getMinValue()
TimeSeriesProcessorTimeSeriesProcessorpublic final T getAverageValue()
TimeSeriesProcessorTimeSeriesProcessorpublic final T getMaxValue()
TimeSeriesProcessorTimeSeriesProcessorpublic java.util.Optional<T> tryGetNearestValue(java.time.ZonedDateTime xValue)
Remark: If the processor is already being accessed by another thread, returns immediately with Optional.empty
xValue - the time stamp to get the value for.Optional instance that contains tthe value for the time position nearest to the one requested if process could complete and value is non-null.public T getNearestValue(java.time.ZonedDateTime xValue)
Remark: If the processor is already being accessed by another thread, waits until lock is released and returns requested value
xValue - the time stamp to get the value for.public java.util.Collection<javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T>> getData()
TimeSeriesProcessor
Remark: the returned collection is a shallow copy of the the processor's own backing collection, so it can be iterated through without risking a concurrent access error even if content is being added or removed to the processor on a seperate thread. However, the the actual data for individual samples are not guarded against concurrent access in any capacity.
TimeSeriesProcessorpublic void setData(java.util.Collection<javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T>> newData)
TimeSeriesProcessor's data storenewData - the list of XYChart.Data points to use as the TimeSeriesProcessor' data.public javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T> getSample(int index)
index - the index of the sample to retrieve.public int size()
public void addSample(javafx.scene.chart.XYChart.Data<java.time.ZonedDateTime,T> sample)
sample - a new sample to add to the processor's data storeprotected abstract T computeMinValue()
protected abstract T computeAverageValue()
protected abstract T computeMaxValue()
Copyright © 2018 Frederic Thevenet. All rights reserved.