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.
Author:
josephramsey
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    get(int row, int col)
     
     
    int
     
    int
     
    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)
     
  • Field Details

  • Method Details

    • numRows

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

      int 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.
      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)
      Returns:
      the value at the given row and column as a Number. If the value is missing, null is uniformly returned.
    • copy

      DataBox copy()
      Returns:
      a copy of this data box.
    • viewSelection

      DataBox viewSelection(int[] rows, int[] cols)
      Returns:
      this data box, restricted to the given rows and columns.
    • like

      DataBox like()