Clover coverage report - baseCode - 0.2.5
Coverage timestamp: Tue Apr 12 2005 11:31:58 EDT
file stats: LOC: 151   Methods: 16
NCLOC: 78   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
StringMatrix2DNamed.java 16.7% 31.4% 43.8% 31.7%
coverage coverage
 1   
 package baseCode.dataStructure.matrix;
 2   
 
 3   
 import cern.colt.matrix.ObjectMatrix1D;
 4   
 import cern.colt.matrix.impl.DenseObjectMatrix2D;
 5   
 
 6   
 /**
 7   
  * A NamedMatrix containing String objects.
 8   
  * <p>
 9   
  * Copyright (c) 2004
 10   
  * </p>
 11   
  * <p>
 12   
  * Institution: Columbia University
 13   
  * </p>
 14   
  * 
 15   
  * @author Paul Pavlidis
 16   
  * @version $Id: StringMatrix2DNamed.java,v 1.2 2004/07/27 03:18:58 pavlidis Exp $
 17   
  */
 18   
 public class StringMatrix2DNamed extends AbstractNamedMatrix {
 19   
 
 20   
    private DenseObjectMatrix2D matrix;
 21   
 
 22  118
    public StringMatrix2DNamed( int x, int y ) {
 23  118
       super();
 24  118
       matrix = new DenseObjectMatrix2D( x, y );
 25   
    }
 26   
 
 27   
    /**
 28   
     * @return java.lang.String
 29   
     */
 30  0
    public String toString() {
 31  0
       String result = "label";
 32  0
       for ( int i = 0; i < columns(); i++ ) {
 33  0
          result = result + "\t" + getColName( i );
 34   
       }
 35  0
       result += "\n";
 36   
 
 37  0
       for ( int i = 0; i < rows(); i++ ) {
 38  0
          result += getRowName( i );
 39  0
          for ( int j = 0; j < columns(); j++ ) {
 40  0
             result = result + "\t" + get( i, j );
 41   
          }
 42  0
          result += "\n";
 43   
       }
 44  0
       return result;
 45   
    }
 46   
 
 47  0
    public Object[] getRow( int row ) {
 48  0
       return viewRow( row ).toArray();
 49   
    }
 50   
 
 51  0
    public Object[] getCol( int col ) {
 52  0
       String[] result = new String[rows()];
 53  0
       for ( int i = 0; i < rows(); i++ ) {
 54  0
          result[i] = ( String ) get( i, col );
 55   
       }
 56  0
       return result;
 57   
    }
 58   
 
 59  99
    public Object[] getRowObj( int row ) {
 60  99
       String[] result = new String[columns()];
 61  99
       for ( int i = 0; i < columns(); i++ ) {
 62  1188
          result[i] = ( String ) get( row, i );
 63   
       }
 64  99
       return result;
 65   
    }
 66   
 
 67  0
    public Object[] getColObj( int col ) {
 68  0
       String[] result = new String[rows()];
 69  0
       for ( int i = 0; i < rows(); i++ ) {
 70  0
          result[i] = ( String ) get( i, col );
 71   
       }
 72  0
       return result;
 73   
    }
 74   
 
 75  2850
    public boolean isMissing( int i, int j ) {
 76  2850
       return get( i, j ) == "";
 77   
    }
 78   
 
 79   
    /**
 80   
     * @return
 81   
     */
 82  45469
    public int columns() {
 83  45469
       return matrix.columns();
 84   
    }
 85   
 
 86   
    /**
 87   
     * @param row
 88   
     * @param column
 89   
     * @return
 90   
     */
 91  6168
    public Object get( int row, int column ) {
 92  6168
       return matrix.get( row, column );
 93   
    }
 94   
 
 95   
    /**
 96   
     * @param row
 97   
     * @param column
 98   
     * @return
 99   
     */
 100  0
    public Object getQuick( int row, int column ) {
 101  0
       return matrix.getQuick( row, column );
 102   
    }
 103   
 
 104   
    /**
 105   
     * @return
 106   
     */
 107  3524
    public int rows() {
 108  3524
       return matrix.rows();
 109   
    }
 110   
 
 111   
    /**
 112   
     * @return
 113   
     */
 114  0
    public int size() {
 115  0
       return matrix.size();
 116   
    }
 117   
 
 118   
    /**
 119   
     * @param column
 120   
     * @return
 121   
     */
 122  0
    public ObjectMatrix1D viewColumn( int column ) {
 123  0
       return matrix.viewColumn( column );
 124   
    }
 125   
 
 126   
    /**
 127   
     * @param row
 128   
     * @return
 129   
     */
 130  0
    public ObjectMatrix1D viewRow( int row ) {
 131  0
       return matrix.viewRow( row );
 132   
    }
 133   
 
 134   
    /**
 135   
     * @param row
 136   
     * @param column
 137   
     * @param value
 138   
     */
 139  41868
    public void set( int row, int column, Object value ) {
 140  41868
       matrix.set( row, column, value );
 141   
    }
 142   
 
 143   
    /**
 144   
     * @param row
 145   
     * @param column
 146   
     * @param value
 147   
     */
 148  0
    public void setQuick( int row, int column, Object value ) {
 149  0
       matrix.setQuick( row, column, value );
 150   
    }
 151   
 }