java.lang.Object
org.rrd4j.data.Source
org.rrd4j.data.PDef
- All Implemented Interfaces:
NonRrdSource
RRD PDEF (Plottable Data Source Definition) implementation.
Creates data sources from plottable objects that can provide values based on timestamps.
Creates data sources from plottable objects that can provide values based on timestamps.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IPlottableThe object whose rendering is exposed as a graph source.Fields inherited from class Source
timestamps, valuesModifier and TypeFieldDescriptionprotected long[]timestamps corresponding to data valuesprotected double[]data valuesConstructor Summary
ConstructorsConstructorDescriptionPDef(String name, IPlottable plottable2) Create a plottable backed by the named data source.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidcalculate(long tStart, long tEnd, DataProcessor dataProcessor) Read one value per timestamp from the plottable and store them.Methods inherited from class Source
getName, getTimestamps, getValues, setTimestamps, setValuesModifier and TypeMethodDescription(package private) StringgetName()Returns the source name.(package private) long[]The time, in seconds since the epoch, of each recorded value.(package private) double[]Returns the data values.(package private) voidsetTimestamps(long[] timestamps) Sets the timestamps.(package private) voidsetValues(double[] values) Sets the data values.
Field Details
plottable
The object whose rendering is exposed as a graph source.
Constructor Details
PDef
PDef(String name, IPlottable plottable2) Create a plottable backed by the named data source.- Parameters:
name- the name of the data sourceplottable2- the plottable object to provide values
Method Details
calculate
Read one value per timestamp from the plottable and store them.- Specified by:
calculatein interfaceNonRrdSource- Parameters:
tStart- first timestamp of the interval, inclusivetEnd- last timestamp of the interval, exclusivedataProcessor- the processor receiving the computed values