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:
  • Constructor Details

    • ObjectMatrixImpl

      public ObjectMatrixImpl(int x, int y)
  • Method Details

    • subsetColumns

      public ObjectMatrixImpl<R,C,V> subsetColumns(List<C> columns)
      Specified by:
      subsetColumns in interface ObjectMatrix<R,C,V>
      Parameters:
      columns -
      Returns:
    • columns

      public int columns()
      Description copied from interface: Matrix2D
      Get the number of columns the matrix has.
      Specified by:
      columns in interface Matrix2D<R,C,V>
      Returns:
    • get

      public V get(int row, int column)
      Specified by:
      get in interface ObjectMatrix<R,C,V>
      Parameters:
      row -
      column -
      Returns:
    • get

      public Object get(R row, C column)
    • getByKeys

      public V getByKeys(R r, C c)
      Specified by:
      getByKeys in interface Matrix2D<R,C,V>
      Parameters:
      r -
      c -
    • getColumn

      public V[] getColumn(int col)
      Specified by:
      getColumn in interface ObjectMatrix<R,C,V>
    • getEntry

      public V getEntry(int row, int column)
      Specified by:
      getEntry in interface Matrix2D<R,C,V>
      Parameters:
      row -
      column -
      Returns:
    • getRow

      public V[] getRow(int row)
      Specified by:
      getRow in interface ObjectMatrix<R,C,V>
    • isMissing

      public boolean isMissing(int i, int j)
      Description copied from interface: Matrix2D
      Check if the value at a given index is missing.
      Specified by:
      isMissing in interface Matrix2D<R,C,V>
      Parameters:
      i - row
      j - column
      Returns:
      true if the value is missing, false otherwise.
    • rows

      public int rows()
      Description copied from interface: Matrix2D
      Get the number of rows the matrix has
      Specified by:
      rows in interface Matrix2D<R,C,V>
      Returns:
    • set

      public void set(int row, int column, V value)
      Specified by:
      set in interface Matrix2D<R,C,V>
      Parameters:
      row -
      column -
      value -
    • setByKeys

      public void setByKeys(R r, C c, V v)
      Specified by:
      setByKeys in interface Matrix2D<R,C,V>
      Parameters:
      r -
      c -
      v -
    • size

      public int size()
      Specified by:
      size in class AbstractMatrix<R,C,V>
      Returns:
    • subset

      public ObjectMatrix<R,C,V> subset(int startRow, int startCol, int numRow, int numCol)
      Specified by:
      subset in interface ObjectMatrix<R,C,V>
      Parameters:
      startRow -
      startCol -
      numRow -
      numCol -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • viewColumn

      public ObjectMatrix1D viewColumn(int column)
      Parameters:
      column -
      Returns:
    • viewRow

      public ObjectMatrix1D viewRow(int row)
      Parameters:
      row -
      Returns: