Class StringMatrix<R,C>
- java.lang.Object
-
- ubic.basecode.dataStructure.matrix.AbstractMatrix<R,C,String>
-
- ubic.basecode.dataStructure.matrix.StringMatrix<R,C>
-
- All Implemented Interfaces:
Serializable,Matrix2D<R,C,String>,ObjectMatrix<R,C,String>
public class StringMatrix<R,C> extends AbstractMatrix<R,C,String> implements ObjectMatrix<R,C,String>
A NamedMatrix containing String objects.- Author:
- Paul 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 StringMatrix(int x, int y)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcolumns()Get the number of columns the matrix has.Stringget(int row, int column)Stringget(R row, C column)StringgetByKeys(R r, C c)String[]getColObj(int col)String[]getColumn(int col)StringgetEntry(int row, int column)StringgetObject(int row, int col)String[]getRow(int row)booleanisMissing(int i, int j)Strings are considered missing if they are whitespace, null or empty.introws()Get the number of rows the matrix hasvoidset(int row, int column, String value)voidsetByKeys(R r, C c, String v)intsize()ObjectMatrix<R,C,String>subset(int startRow, int startCol, int numRow, int numCol)ObjectMatrix<R,C,String>subsetColumns(List<C> columns)StringtoString()cern.colt.matrix.ObjectMatrix1DviewColumn(int column)cern.colt.matrix.ObjectMatrix1DviewRow(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 ObjectMatrix<R,C,String> subsetColumns(List<C> columns)
- Specified by:
subsetColumnsin interfaceObjectMatrix<R,C,String>- Parameters:
columns-- Returns:
-
columns
public int columns()
Description copied from interface:Matrix2DGet the number of columns the matrix has.
-
get
public String get(int row, int column)
- Specified by:
getin interfaceObjectMatrix<R,C,String>- Parameters:
row-column-- Returns:
-
getColObj
public String[] getColObj(int col)
-
getColumn
public String[] getColumn(int col)
- Specified by:
getColumnin interfaceObjectMatrix<R,C,String>
-
getEntry
public String getEntry(int row, int column)
-
getObject
public String getObject(int row, int col)
-
getRow
public String[] getRow(int row)
- Specified by:
getRowin interfaceObjectMatrix<R,C,String>
-
isMissing
public boolean isMissing(int i, int j)Strings are considered missing if they are whitespace, null or empty.
-
rows
public int rows()
Description copied from interface:Matrix2DGet the number of rows the matrix has
-
set
public void set(int row, int column, String value)
-
size
public int size()
- Specified by:
sizein classAbstractMatrix<R,C,String>- Returns:
-
subset
public ObjectMatrix<R,C,String> subset(int startRow, int startCol, int numRow, int numCol)
- Specified by:
subsetin interfaceObjectMatrix<R,C,String>- 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:
-
-