Bug 19294 - [RFE] toString() for the HSSFCell
Summary: [RFE] toString() for the HSSFCell
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-24 22:01 UTC by Wes Gilster
Modified: 2005-05-20 03:14 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wes Gilster 2003-04-24 22:01:35 UTC
How about a toString() for the HSSFCell?
public String toString() {
	switch 
(getCellType()) {
		case CELL_TYPE_BLANK:
			return "";
		case 
CELL_TYPE_BOOLEAN:
			return getBooleanCellValue()?"True":"False");
		case 
CELL_TYPE_ERROR:
			return getErrorCellValue() + "";
		case 
CELL_TYPE_FORMULA:
			return getStringCellValue();//I don't know how to do 
this???
		case CELL_TYPE_NUMERIC:
			return  cell.getNumericCellValue() + "";
		case 
CELL_TYPE_STRING:
			return cell.getStringCellValue();
		default:
			return 
"Unknown Cell Type: " + cell.getCellType();
	}
}
Comment 1 Donald Bell 2003-04-26 22:07:01 UTC
This sounds a lot like the functionality that was requested in Bug 15303.

I posted a solution that, but have never heard back.  I personally like my 
solution that was posted on Bug 15303 (but I'm probably bais).
Comment 2 Andy Oliver 2003-07-24 16:20:37 UTC
No objection, submit a patch.
Comment 3 Avik Sengupta 2005-05-20 11:14:58 UTC
Comitted, with some modifications. Thanks. 

Testcase added. Would have been much faster is there was a testcase along with
this.