org.rrd4j.core.jrrd

## Class Archive

- java.lang.Object
- - org.rrd4j.core.jrrd.Archive

-     public class Archive
      extends Object

  Instances of this class model an archive section of an RRD file.
  Version:
    $Revision: 1.1 $

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) List<CDPStatusBlock>` | `cdpStatusBlocks` Consolidation data points status blocks.
    `(package private) int` | `currentRow` Row for last modification time of database.
    `(package private) long` | `dataOffset` Data offset within file in bytes.
    `(package private) RRDatabase` | `db` The parent RRD database.
    `(package private) long` | `headerOffset` Header offset within file in bytes.
    `(package private) int` | `pdpCount` Number of primary data points per consolidated data point.
    `(package private) int` | `rowCount` Data row count.
    `(package private) double` | `xff` X-Files factor for this archive.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Archive(RRDatabase db)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CDPStatusBlock` | `getCDPStatusBlock(int index)` Returns the `CDPStatusBlock` at the specified position in this archive.
    `Iterator<CDPStatusBlock>` | `getCDPStatusBlocks()` Returns an iterator over the CDP status blocks in this archive in proper sequence.
    `int` | `getPdpCount()` Returns the number of primary data points required for a consolidated data point in this archive.
    `int` | `getRowCount()` Returns the number of entries in this archive.
    `ConsolidationFunctionType` | `getType()` Returns the type of function used to calculate the consolidated data point.
    `double[][]` | `getValues()` Getter for the field `values`.
    `double` | `getXff()` Returns the X-Files Factor for this archive.
    `(package private) void` | `loadCDPStatusBlocks(RRDFile file, int numBlocks)` Loads CDP status blocks from the RRD file.
    `(package private) void` | `loadCurrentRow(RRDFile file)` Loads the current row index from the RRD file.
    `(package private) void` | `loadData(DataChunk chunk)` Loads archive data from a data chunk.
    `(package private) void` | `loadData(RRDFile file, int dsCount)` Loads archive data from the RRD file, skipping to the next archive.
    `(package private) void` | `printInfo(PrintStream s, NumberFormat numberFormat, int index)` Prints information about this archive to the specified print stream.
    `String` | `toString()` Returns a summary the contents of this archive.
    `(package private) void` | `toXml(PrintStream s)` Writes XML representation of this archive to the specified print stream.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### cdpStatusBlocks

          List<CDPStatusBlock> cdpStatusBlocks

      Consolidation data points status blocks.

    - #### currentRow

          int currentRow

      Row for last modification time of database.

    - #### dataOffset

          long dataOffset

      Data offset within file in bytes.

    - #### db

          final RRDatabase db

      The parent RRD database.

    - #### headerOffset

          final long headerOffset

      Header offset within file in bytes.

    - #### pdpCount

          final int pdpCount

      Number of primary data points per consolidated data point.

    - #### rowCount

          final int rowCount

      Data row count.

    - #### xff

          final double xff

      X-Files factor for this archive.

  - ### Constructor Detail

    - #### Archive

          Archive(RRDatabase db)

  - ### Method Detail

    - #### getCDPStatusBlock

          public CDPStatusBlock getCDPStatusBlock(int index)

      Returns the `CDPStatusBlock` at the specified position in this archive.
      Parameters:
        `index` - index of `CDPStatusBlock` to return.
      Returns:
        the `CDPStatusBlock` at the specified position in this archive.

    - #### getCDPStatusBlocks

          public Iterator<CDPStatusBlock> getCDPStatusBlocks()

      Returns an iterator over the CDP status blocks in this archive in proper sequence.
      Returns:
        an iterator over the CDP status blocks in this archive in proper sequence.
      See Also:
        `CDPStatusBlock`

    - #### getPdpCount

          public int getPdpCount()

      Returns the number of primary data points required for a consolidated data point in this archive.
      Returns:
        the number of primary data points required for a consolidated data point in this archive.

    - #### getRowCount

          public int getRowCount()

      Returns the number of entries in this archive.
      Returns:
        the number of entries in this archive.

    - #### getType

          public ConsolidationFunctionType getType()

      Returns the type of function used to calculate the consolidated data point.
      Returns:
        the type of function used to calculate the consolidated data point.

    - #### getValues

          public double[][] getValues()

      Getter for the field `values`.
      Returns:
        an array of double.

    - #### getXff

          public double getXff()

      Returns the X-Files Factor for this archive.
      Returns:
        the X-Files Factor for this archive.

    - #### loadCDPStatusBlocks

          void loadCDPStatusBlocks(RRDFile file,
                                   int numBlocks)

      Loads CDP status blocks from the RRD file.
      Parameters:
        `file` - The RRD file to read from.
        `numBlocks` - The number of CDP status blocks to load.

    - #### loadCurrentRow

          void loadCurrentRow(RRDFile file)

      Loads the current row index from the RRD file.
      Parameters:
        `file` - The RRD file to read from.

    - #### loadData

          void loadData(DataChunk chunk)

      Loads archive data from a data chunk.
      Parameters:
        `chunk` - The data chunk containing archive data.

    - #### loadData

          void loadData(RRDFile file,
                        int dsCount)

      Loads archive data from the RRD file, skipping to the next archive.
      Parameters:
        `file` - The RRD file to read from.
        `dsCount` - Number of data sources in the database.

    - #### printInfo

          void printInfo(PrintStream s,
                         NumberFormat numberFormat,
                         int index)

      Prints information about this archive to the specified print stream.
      Parameters:
        `s` - Print stream to write to.
        `numberFormat` - Number format for displaying values.
        `index` - Archive index in the database.

    - #### toString

          public String toString()

      Returns a summary the contents of this archive.
      Overrides:
        `toString` in class `Object`
      Returns:
        a summary of the information contained in this archive.

    - #### toXml

          void toXml(PrintStream s)

      Writes XML representation of this archive to the specified print stream.
      Parameters:
        `s` - Print stream to write to.