test_class.declarator: spreadsheetReader
test_class.modifier: private
test_class.original_string: private SpreadsheetReader spreadsheetReader;
test_class.type: SpreadsheetReader
test_class.var_name: spreadsheetReader
test_class.file: taverna-spreadsheet-import-activity/src/test/java/org/apache/taverna/activities/spreadsheet/CSVSpreadsheetReaderTest.java
test_class.identifier: CSVSpreadsheetReaderTest
test_case.body: @Test(expected=SpreadsheetReadException.class)
  	public void testReadException() throws Exception {
  		spreadsheetReader.read(new InputStream() {
  			public int read() throws IOException {
  				throw new IOException();
  			}			
  		}, new Range(0,1), new Range(0,1), false, new SpreadsheetRowProcessor() {
  			public void processRow(int rowIndex, SortedMap<Integer, String> rowData) {				
  			}			
  		});
  	}
test_case.class_method_signature: CSVSpreadsheetReaderTest.testReadException()
test_case.full_signature: @Test(expected=SpreadsheetReadException.class) public void testReadException()
test_case.identifier: testReadException
test_case.invocations: read
test_case.modifiers: @Test(expected=SpreadsheetReadException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReadException()
focal_class.file: taverna-spreadsheet-import-activity/src/main/java/org/apache/taverna/activities/spreadsheet/CSVSpreadsheetReader.java
focal_class.identifier: CSVSpreadsheetReader
focal_class.interfaces: implements SpreadsheetReader
focal_class.class_method_signature: CSVSpreadsheetReader.read(InputStream inputStream, Range rowRange,
  			Range columnRange, boolean ignoreBlankRows,
  			SpreadsheetRowProcessor rowProcessor)
focal_class.full_signature: public void read(InputStream inputStream, Range rowRange,
  			Range columnRange, boolean ignoreBlankRows,
  			SpreadsheetRowProcessor rowProcessor)
focal_class.identifier: read
focal_class.modifiers: public
focal_class.parameters: (InputStream inputStream, Range rowRange,
  			Range columnRange, boolean ignoreBlankRows,
  			SpreadsheetRowProcessor rowProcessor)
focal_class.return: void
focal_class.signature: void read(InputStream inputStream, Range rowRange,
  			Range columnRange, boolean ignoreBlankRows,
  			SpreadsheetRowProcessor rowProcessor)
focal_method.body: public void read(InputStream inputStream, Range rowRange,
  			Range columnRange, boolean ignoreBlankRows,
  			SpreadsheetRowProcessor rowProcessor)
  			throws SpreadsheetReadException {
  		CsvReader csvReader = new CsvReader(new InputStreamReader(inputStream));
  		csvReader.setSkipEmptyRecords(false);
  
  		SortedMap<Integer, String> currentDataRow = new TreeMap<Integer, String>();
  
  		try {
  			while(csvReader.readRecord()) {
  				int rowIndex = (int) csvReader.getCurrentRecord();
  				boolean blankRow = true;
  				if (rowRange.contains(rowIndex)) {
  					for (int columnIndex = columnRange.getStart(); columnIndex <= columnRange.getEnd(); columnIndex++) {
  						if (columnRange.contains(columnIndex)) {
  							String value = csvReader.get(columnIndex);
  							value = "".equals(value) ? null : value;
  							if (value != null) {
  								blankRow = false;
  							}
  							currentDataRow.put(columnIndex, value);
  							if (columnIndex == columnRange.getEnd()) {
  								if (!ignoreBlankRows || !blankRow) {
  									rowProcessor.processRow(rowIndex, currentDataRow);
  								}
  								currentDataRow = new TreeMap<Integer, String>();
  							}
  						}
  					}
  				
  					if (rowIndex == rowRange.getEnd()) {
  						break;
  					}
  				}
  			}
  		} catch (IOException e) {
  			throw new SpreadsheetReadException("Unable to read CSV file", e);
  		}
  	}
focal_method.class_method_signature: CSVSpreadsheetReader.read(InputStream inputStream, Range rowRange,
  			Range columnRange, boolean ignoreBlankRows,
  			SpreadsheetRowProcessor rowProcessor)
focal_method.full_signature: public void read(InputStream inputStream, Range rowRange,
  			Range columnRange, boolean ignoreBlankRows,
  			SpreadsheetRowProcessor rowProcessor)
focal_method.identifier: read
focal_method.invocations: setSkipEmptyRecords readRecord getCurrentRecord contains getStart getEnd contains get equals put getEnd processRow getEnd
focal_method.modifiers: public
focal_method.parameters: (InputStream inputStream, Range rowRange,
  			Range columnRange, boolean ignoreBlankRows,
  			SpreadsheetRowProcessor rowProcessor)
focal_method.return: void
focal_method.signature: void read(InputStream inputStream, Range rowRange,
  			Range columnRange, boolean ignoreBlankRows,
  			SpreadsheetRowProcessor rowProcessor)