Robin
Keywords: org.jrobin.core.Robin class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jrobin.core
Class Robin

    java.lang.Object
      org.jrobin.core.Robin

All Implemented Interfaces:
  org.jrobin.core.RrdUpdater

public class Robin
extends java.lang.Object
implements org.jrobin.core.RrdUpdater

Class to represent archive values for a single datasource. Robin class is the heart of the so-called "round robin database" concept. Basically, each Robin object is a fixed length array of double values. Each double value reperesents consolidated, archived value for the specific timestamp. When the underlying array of double values gets completely filled, new values will replace the oldest ones.

Robin object does not hold values in memory - such object could be quite large. Instead of it, Robin reads them from the backend I/O only when necessary.

Method Summary
`void` | `copyStateTo(org.jrobin.core.RrdUpdater other)` Copies object's internal state to another Robin object.
`Archive` | `getParent()` Returns the Archive object to which this Robin object belongs.
`org.jrobin.core.RrdAllocator` | `getRrdAllocator()` Required to implement RrdUpdater interface.
`RrdBackend` | `getRrdBackend()` Returns the underlying storage (backend) object which actually performs all I/O operations.
`int` | `getSize()` Returns the size of the underlying array of archived values.
`double` | `getValue(int index)` Returns the i-th value from the Robin archive.
`double[]` | `getValues()` Fetches all archived values.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getValues

    public double[] getValues()
                       throws java.io.IOException

  Fetches all archived values.

  Returns:
    Array of double archive values, starting from the oldest one.
  Throws:
    `java.io.IOException` - Thrown in case of I/O specific error.

### getValue

    public double getValue(int index)
                    throws java.io.IOException

  Returns the i-th value from the Robin archive.

  Parameters:
    `index` - Value index
  Returns:
    Value stored in the i-th position (the oldest value has zero index)
  Throws:
    `java.io.IOException` - Thrown in case of I/O specific error.

### getParent

    public Archive getParent()

  Returns the Archive object to which this Robin object belongs.

  Returns:
    Parent Archive object

### getSize

    public int getSize()

  Returns the size of the underlying array of archived values.

  Returns:
    Number of stored values

### copyStateTo

    public void copyStateTo(org.jrobin.core.RrdUpdater other)
                     throws java.io.IOException,
                            RrdException

  Copies object's internal state to another Robin object.

  Specified by:
    `copyStateTo` in interface `org.jrobin.core.RrdUpdater`
  Parameters:
    `other` - New Robin object to copy state to
  Throws:
    `java.io.IOException` - Thrown in case of I/O error
    `RrdException` - Thrown if supplied argument is not a Robin object

### getRrdBackend

    public RrdBackend getRrdBackend()

  Returns the underlying storage (backend) object which actually performs all I/O operations.

  Specified by:
    `getRrdBackend` in interface `org.jrobin.core.RrdUpdater`
  Returns:
    I/O backend object

### getRrdAllocator

    public org.jrobin.core.RrdAllocator getRrdAllocator()

  Required to implement RrdUpdater interface. You should never call this method directly.

  Specified by:
    `getRrdAllocator` in interface `org.jrobin.core.RrdUpdater`
  Returns:
    Allocator object

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD