public String getCell ( String row , String col ) throws Exception { if ( col . equals ( this . getIndexColumnName ( ) ) ) { return row ; } HeaderInfo rowIndex = rowLookup . get ( row ) ; HeaderInfo colIndex = columnLookup . get ( col ) ; if ( rowIndex == null ) { //allow for case insentive search for ( String rowtable : rowLookup . keySet ( ) ) { if ( row . equalsIgnoreCase ( rowtable ) ) { rowIndex = rowLookup . get ( rowtable ) ; break ; } } if ( rowIndex == null ) { throw new Exception ( "Row " + row + " not found in worksheet" ) ; } } if ( colIndex == null ) { //allow for case insentive search for ( String coltable : columnLookup . keySet ( ) ) { if ( col . equalsIgnoreCase ( coltable ) ) { colIndex = columnLookup . get ( coltable ) ; break ; } } if ( colIndex == null ) { throw new Exception ( "Column " + col + " not found in worksheet" ) ; } } CompactCharSequence ccs = data [ rowIndex . getIndex ( ) ] [ colIndex . getIndex ( ) ] ; if ( ccs != null ) { return ccs . toString ( ) ; } else { return "" ; } // return .toString(); }
Get cell value