Type Parameters:
U - the updater type

class RrdInt<U extends RrdUpdater<U>>extends RrdPrimitive<U>
RRD integer primitive type.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    Value read from or written to the file.
    private boolean
    True while the cache holds the current value.

    Fields inherited from class RrdPrimitive

    RRD_DOUBLE, RRD_INT, RRD_LONG, RRD_PRIM_SIZES, RRD_STRING, STRING_LENGTH
    Modifier and Type
    Field
    Description
    (package private) static final int
    Type identifier for double RRD primitives.
    (package private) static final int
    Type identifier for integer RRD primitives.
    (package private) static final int
    Type identifier for long RRD primitives.
    (package private) static final int[]
    Array containing the size in bytes for each RRD primitive type.
    (package private) static final int
    Type identifier for string RRD primitives.
    (package private) static final int
    Maximum length of string values stored in RRD primitives.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RrdInt(RrdUpdater<U> updater)
    Creates a new RRD integer primitive.
    RrdInt(RrdUpdater<U> updater, boolean isConstant)
    Creates a new RRD integer primitive.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    (package private) int
    get()
    Gets the integer value.
    (package private) void
    set(int value)
    Sets the integer value.

    Methods inherited from class RrdPrimitive

    isCachingAllowed, readBytes, readDouble, readDouble, readDouble, readEnum, readInt, readLong, readString, writeBytes, writeDouble, writeDouble, writeDouble, writeDouble, writeEnum, writeInt, writeLong, writeString
    Modifier and Type
    Method
    Description
    (package private) final boolean
    Checks if caching is allowed for this primitive.
    (package private) final byte[]
    Raw byte array from backend storage.
    (package private) final double
    Reads the double value from backend storage.
    (package private) final double
    readDouble(int index)
    Position in the primitive array.
    (package private) final double[]
    readDouble(int index, int count)
    Starting position in the primitive array.
    protected final <E extends Enum<E>>
    E
    readEnum(Class<E> clazz)
    Deserialize an enum value from backend storage.
    (package private) final int
    Reads the int value from backend storage.
    (package private) final long
    Reads the long value from backend storage.
    (package private) final String
    Reads the string value from backend storage.
    (package private) final void
    writeBytes(byte[] b)
    Byte array to write to backend storage.
    (package private) final void
    writeDouble(double value)
    Double value to write to backend storage.
    (package private) final void
    writeDouble(int index, double value)
    Position in the primitive array.
    (package private) final void
    writeDouble(int index, double[] values)
    Starting position in the primitive array.
    (package private) final void
    writeDouble(int index, double value, int count)
    Starting position in the primitive array.
    protected final <E extends Enum<E>>
    void
    writeEnum(E value)
    Serialize an enum value to backend storage.
    (package private) final void
    writeInt(int value)
    Int value to write to backend storage.
    (package private) final void
    writeLong(long value)
    Long value to write to backend storage.
    (package private) final void
    String value to write to backend storage.

    Methods inherited from class Object

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

    • cache

      private int cache
      Value read from or written to the file.
    • cached

      private boolean cached
      True while the cache holds the current value.
  • Constructor Details

    • RrdInt

      RrdInt(RrdUpdater<U> updater, boolean isConstant)
      Creates a new RRD integer primitive.
      Parameters:
      updater - called with the new value whenever the primitive changes
      isConstant - whether this is a constant value
    • RrdInt

      RrdInt(RrdUpdater<U> updater)
      Creates a new RRD integer primitive.
      Parameters:
      updater - called with the new value whenever the primitive changes
  • Method Details

    • set

      void set(int value) throws IOException
      Sets the integer value.
      Parameters:
      value - the value to set
      Throws:
      IOException - if an I/O error occurs
    • get

      int get() throws IOException
      Gets the integer value.
      Returns:
      the integer value
      Throws:
      IOException - if an I/O error occurs