You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2008/09/30 15:41:03 UTC

DO NOT REPLY [Bug 45919] [PATCH] Crucial classes made inheritable: HSSFWorkbook, HSSFSheet, HSSFRow and HSSFCell

https://issues.apache.org/bugzilla/show_bug.cgi?id=45919





--- Comment #1 from Thomas Guretzki <th...@gmx.de>  2008-09-30 06:41:01 PST ---
[sorry for the break]
With these patches, it is possible to derive classes from HSSFCell and the
linked classes HSSFRow, HSSFSheet and HSSFWorkbook.
This can be very useful if you want to use inherent references between these
objects in your own code which uses additional attributes e.g. of cells. That
way,  one does not have to create one's own ArrayLists, e.g. of the cells of
every row. Plus you get all HSSFCell methods for free without any code. 

The main change to make this possible was to create working public constuctors
in HSSFSheet, HSSFRow and HSSFCell. Before, there were only creator methods in
the respective superior class, e.g. createRow in HSSFSheet. These continue to
exists, but they simply call the respective constructors. There are some
details beyond this concerning how to get the newly created e.g. HSSFCells into
the administration of their HSSFRow, but you can look that up in the code.

If you extend only one of these classes, be aware that you _must_ use its
constructor for newly created objects. For example, if you extend HSSFSheet,
you call "new HSSFSheet (HSSFWorkbook, String)" and pass it an existing
HSSFWorkbook and the name of the new sheet.
If you want to use the createSheet method of HSSFWorkbook, you have to extend
that class and override that method, containing code like "result=new HSSFSheet
(HSSFWorkbook, String)". 
The code contains hints like "##Override..." to quickly find the concerned
methods.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org