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

class UnivalArrayextends Object
This class is used to read a unival from a file unival is a rrdtool type, defined in rrd_format.h
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final ByteBuffer
    The buffer holding the array's values.
    private final int
    Size in bytes of one native long.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UnivalArray(RRDFile file, int size)
    Read an UnivalArray from a rrd native file at the current position
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    double
    Reads the double stored at the slot the enum's ordinal selects.
    long
    getLong(Enum<?> e)
    Reads the long stored at the slot the enum's ordinal selects.

    Methods inherited from class Object

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

    • buffer

      private final ByteBuffer buffer
      The buffer holding the array's values.
    • sizeoflong

      private final int sizeoflong
      Size in bytes of one native long.
  • Constructor Details

    • UnivalArray

      public UnivalArray(RRDFile file, int size)
      Read an UnivalArray from a rrd native file at the current position
      Parameters:
      file - the RRdFile, read from its current position after aligning
      size - the numer of elements in the array
  • Method Details

    • getLong

      public long getLong(Enum<?> e)
      Reads the long stored at the slot the enum's ordinal selects.
      Parameters:
      e - a Enum object.
      Returns:
      the value from that slot, widened to 64 bits when the file uses 32-bit longs
    • getDouble

      public double getDouble(Enum<?> e)
      Reads the double stored at the slot the enum's ordinal selects.
      Parameters:
      e - a Enum object.
      Returns:
      the eight-byte floating point value stored at that slot