Class DataChunk

java.lang.Object
org.rrd4j.core.jrrd.DataChunk

public class DataChunk extends Object
Models a chunk of result data from an RRDatabase.
Version:
$Revision: 1.1 $
Author:
Ciaran Treanor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final double[][]
     
    (package private) final int
    Number of datasources must be equal to number of datasources in file
    (package private) final int
    Row number offset relative to current row
    (package private) final int
    Row number offset relative to current row.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DataChunk(Map<String,Integer> nameindex, long startTime, int startOffset, int endOffset, long step, int dsCount, int rows)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double[][]
    Getter for the field data.
    int
     
    int
     
    int
     
    long
     
    long[]
    Getter for the time stamps values.
    Extract a datasource from the datachunck given is name as a Plottable
    Returns a summary of the contents of this data chunk.

    Methods inherited from class java.lang.Object

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

    • startOffset

      final int startOffset
      Row number offset relative to current row. Can be negative
    • endOffset

      final int endOffset
      Row number offset relative to current row
    • dsCount

      final int dsCount
      Number of datasources must be equal to number of datasources in file
    • data

      final double[][] data
  • Constructor Details

    • DataChunk

      DataChunk(Map<String,Integer> nameindex, long startTime, int startOffset, int endOffset, long step, int dsCount, int rows)
  • Method Details

    • toString

      public String toString()
      Returns a summary of the contents of this data chunk. The first column is the time (RRD format) and the following columns are the data source values.
      Overrides:
      toString in class Object
      Returns:
      a summary of the contents of this data chunk.
    • getStart

      public int getStart()
    • getEnd

      public int getEnd()
    • getStep

      public long getStep()
    • getDsCount

      public int getDsCount()
    • getData

      public double[][] getData()

      Getter for the field data.

      Returns:
      the data
    • getTimestamps

      public long[] getTimestamps()

      Getter for the time stamps values.

      Returns:
      array of time stamps in seconds
    • toPlottable

      public Plottable toPlottable(String name)
      Extract a datasource from the datachunck given is name as a Plottable
      Parameters:
      name - the datasource name
      Returns:
      a plottable for the datasource