Package edu.cmu.tetrad.data
Class ByteDataBox
java.lang.Object
edu.cmu.tetrad.data.ByteDataBox
- All Implemented Interfaces:
DataBox
,TetradSerializable
,Serializable
Stores a 2D array of byte data. Note that the missing value marker for this box is -99.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionByteDataBox
(byte[][] data) Constructs a new data box using the given 2D byte data array as data.ByteDataBox
(int rows, int cols) Constructs an 2D byte array consisting entirely of missing values (-99). -
Method Summary
Modifier and TypeMethodDescriptioncopy()
get
(int row, int col) like()
Returns a data box of the same dimensions as this one, without setting any values.int
numCols()
int
numRows()
static BoxDataSet
Generates a simple exemplar of this class to test serialization.void
Sets the value at the given row/column to the given Number value.viewSelection
(int[] rows, int[] cols)
-
Constructor Details
-
ByteDataBox
public ByteDataBox(int rows, int cols) Constructs an 2D byte array consisting entirely of missing values (-99).- Parameters:
rows
- the number of rows.cols
- the number of columns.
-
ByteDataBox
public ByteDataBox(byte[][] data) Constructs a new data box using the given 2D byte data array as data.- Parameters:
data
- the data to use.
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a simple exemplar of this class to test serialization.
-
numRows
public int numRows() -
numCols
public int numCols() -
set
Sets the value at the given row/column to the given Number value. The value used is number.byteValue(). If the value is null, the missing value marker (-99) is used. -
get
-
copy
-
like
Description copied from interface:DataBox
Returns a data box of the same dimensions as this one, without setting any values. -
viewSelection
- Specified by:
viewSelection
in interfaceDataBox
- Parameters:
rows
- the row indices.cols
- the column indices.- Returns:
- this data box, restricted to the given rows and columns.
-