org.rrd4j.core.jrrd

## 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 $

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) double[][]` | `data`
    `(package private) int` | `dsCount` Number of datasources must be equal to number of datasources in file
    `(package private) int` | `endOffset` Row number offset relative to current row
    `(package private) int` | `startOffset` Row number offset relative to current row.

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double[][]` | `getData()` Getter for the field `data`.
    `int` | `getDsCount()`
    `int` | `getEnd()`
    `int` | `getStart()`
    `long` | `getStep()`
    `long[]` | `getTimestamps()` Getter for the time stamps values.
    `org.rrd4j.data.Plottable` | `toPlottable(String name)` Extract a datasource from the datachunck given is name as a Plottable
    `String` | `toString()` 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 Detail

    - #### data

          final double[][] data

    - #### dsCount

          final int dsCount

      Number of datasources must be equal to number of datasources in file

    - #### endOffset

          final int endOffset

      Row number offset relative to current row

    - #### startOffset

          final int startOffset

      Row number offset relative to current row. Can be negative

  - ### Constructor Detail

    - #### DataChunk

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

  - ### Method Detail

    - #### getData

          public double[][] getData()

      Getter for the field `data`.
      Returns:
        the data

    - #### getDsCount

          public int getDsCount()

    - #### getEnd

          public int getEnd()

    - #### getStart

          public int getStart()

    - #### getStep

          public long getStep()

    - #### getTimestamps

          public long[] getTimestamps()

      Getter for the time stamps values.
      Returns:
        array of time stamps in seconds

    - #### toPlottable

          public org.rrd4j.data.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

    - #### 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.