Class ObjectMatrixImpl<R,C,V>
- java.lang.Object
-
- ubic.basecode.dataStructure.matrix.AbstractMatrix<R,C,V>
-
- ubic.basecode.dataStructure.matrix.ObjectMatrixImpl<R,C,V>
-
- All Implemented Interfaces:
Serializable
,Matrix2D<R,C,V>
,ObjectMatrix<R,C,V>
public class ObjectMatrixImpl<R,C,V> extends AbstractMatrix<R,C,V> implements ObjectMatrix<R,C,V>
Matrix that can hold any type of object- Author:
- pavlidis
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class ubic.basecode.dataStructure.matrix.AbstractMatrix
MAX_ROWS_TO_PRINT
-
-
Constructor Summary
Constructors Constructor Description ObjectMatrixImpl(int x, int y)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
columns()
Get the number of columns the matrix has.V
get(int row, int column)
Object
get(R row, C column)
V
getByKeys(R r, C c)
V[]
getColumn(int col)
V
getEntry(int row, int column)
V[]
getRow(int row)
boolean
isMissing(int i, int j)
Check if the value at a given index is missing.int
rows()
Get the number of rows the matrix hasvoid
set(int row, int column, V value)
void
setByKeys(R r, C c, V v)
int
size()
ObjectMatrix<R,C,V>
subset(int startRow, int startCol, int numRow, int numCol)
ObjectMatrixImpl<R,C,V>
subsetColumns(List<C> columns)
String
toString()
cern.colt.matrix.ObjectMatrix1D
viewColumn(int column)
cern.colt.matrix.ObjectMatrix1D
viewRow(int row)
-
Methods inherited from class ubic.basecode.dataStructure.matrix.AbstractMatrix
addColumnName, addRowName, asDoubles, assign, checkColRange, checkRowRange, containsColumnName, containsRowName, getColIndexByName, getColName, getColNames, getRowIndexByName, getRowName, getRowNameMapIterator, getRowNames, hasColNames, hasMissingValues, hasRow, hasRowNames, numMissing, setColumnName, setColumnNames, setRowName, setRowNames
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ubic.basecode.dataStructure.matrix.Matrix2D
addColumnName, asDoubles, assign, containsColumnName, containsRowName, getColIndexByName, getColName, getColNames, getRowIndexByName, getRowName, getRowNameMapIterator, getRowNames, hasColNames, hasRow, hasRowNames, numMissing, setColumnName, setColumnNames, setRowName, setRowNames
-
-
-
-
Method Detail
-
subsetColumns
public ObjectMatrixImpl<R,C,V> subsetColumns(List<C> columns)
- Specified by:
subsetColumns
in interfaceObjectMatrix<R,C,V>
- Parameters:
columns
-- Returns:
-
columns
public int columns()
Description copied from interface:Matrix2D
Get the number of columns the matrix has.
-
get
public V get(int row, int column)
- Specified by:
get
in interfaceObjectMatrix<R,C,V>
- Parameters:
row
-column
-- Returns:
-
getEntry
public V getEntry(int row, int column)
-
isMissing
public boolean isMissing(int i, int j)
Description copied from interface:Matrix2D
Check if the value at a given index is missing.
-
rows
public int rows()
Description copied from interface:Matrix2D
Get the number of rows the matrix has
-
size
public int size()
- Specified by:
size
in classAbstractMatrix<R,C,V>
- Returns:
-
subset
public ObjectMatrix<R,C,V> subset(int startRow, int startCol, int numRow, int numCol)
- Specified by:
subset
in interfaceObjectMatrix<R,C,V>
- Returns:
-
viewColumn
public cern.colt.matrix.ObjectMatrix1D viewColumn(int column)
- Parameters:
column
-- Returns:
-
viewRow
public cern.colt.matrix.ObjectMatrix1D viewRow(int row)
- Parameters:
row
-- Returns:
-
-