Interface DataBox

All Superinterfaces:
Serializable, TetradSerializable
All Known Implementing Classes:
ByteDataBox, DoubleDataBox, FloatDataBox, IntDataBox, LongDataBox, MixedDataBox, ShortDataBox, VerticalDoubleDataBox, VerticalIntDataBox

public interface DataBox extends TetradSerializable
Stores a 2D array of data. Different implementations may store data in different ways, allowing for space or time efficiency.
Version:
$Id: $Id
Author:
josephramsey
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Constant serialVersionUID=23L
  • Method Summary

    Modifier and Type
    Method
    Description
    copy.
    get(int row, int col)
    get.
    Returns a data box of the same dimensions as this one, without setting any values.
    int
    numCols.
    int
    numRows.
    void
    set(int row, int col, Number value)
    Sets the value at the given row and column to the given Number.
    viewSelection(int[] rows, int[] cols)
    viewSelection.
  • Field Details

    • serialVersionUID

      static final long serialVersionUID
      Constant serialVersionUID=23L
      See Also:
  • Method Details

    • numRows

      int numRows()

      numRows.

      Returns:
      the (fixed) number of rows of the dataset.
    • numCols

      int numCols()

      numCols.

      Returns:
      the (fixed) number of columns of the dataset.
    • set

      void set(int row, int col, Number value) throws IllegalArgumentException
      Sets the value at the given row and column to the given Number. This number may be interpreted differently depending on how values are stored. A value of null is interpreted as a missing value.
      Parameters:
      row - the row index.
      col - the column index.
      value - the value to store.
      Throws:
      IllegalArgumentException - if the given value cannot be stored (because it's out of range or cannot be converted or whatever).
    • get

      Number get(int row, int col)

      get.

      Parameters:
      row - the row index.
      col - the column index.
      Returns:
      the value at the given row and column as a Number. If the value is missing, null is uniformly returned.
    • copy

      DataBox copy()

      copy.

      Returns:
      a copy of this data box.
    • viewSelection

      DataBox viewSelection(int[] rows, int[] cols)

      viewSelection.

      Parameters:
      rows - the row indices.
      cols - the column indices.
      Returns:
      this data box, restricted to the given rows and columns.
    • like

      DataBox like()
      Returns a data box of the same dimensions as this one, without setting any values.
      Returns:
      a new data box.