java.lang.Object
org.rrd4j.data.Source
Direct Known Subclasses:
CDef, Def, PDef, VDef

abstract class Sourceextends Object
Abstract base class for RRD data sources.
Provides common functionality for storing and managing time-series data with timestamps and values.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
    Name other definitions use to refer to this source.
    protected long[]
    timestamps corresponding to data values
    protected double[]
    data values
  • Constructor Summary

    Constructors
    Constructor
    Description
    Source(String name)
    Creates a new Source with the given name.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    (package private) String
    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) void
    setTimestamps(long[] timestamps)
    Sets the timestamps.
    (package private) void
    setValues(double[] values)
    Sets the data values.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • name

      private final String name
      Name other definitions use to refer to this source.
    • values

      protected double[] values
      data values
    • timestamps

      protected long[] timestamps
      timestamps corresponding to data values
  • Constructor Details

    • Source

      Source(String name)
      Creates a new Source with the given name.
      Parameters:
      name - the source name
  • Method Details

    • getName

      String getName()
      Returns the source name.
      Returns:
      the source name, as passed to the constructor
    • setValues

      void setValues(double[] values)
      Sets the data values.
      Parameters:
      values - the data values array
    • setTimestamps

      void setTimestamps(long[] timestamps)
      Sets the timestamps.
      Parameters:
      timestamps - the timestamps array
    • getValues

      double[] getValues()
      Returns the data values.
      Returns:
      the values array
    • getTimestamps

      long[] getTimestamps()
      The time, in seconds since the epoch, of each recorded value.
      Returns:
      the array of timestamps, index-aligned with getValues()