| Method from org.apache.cocoon.poi.hssf.usermodel.HSSFSheet Detail: |
public HSSFRow createRow(short rownum) {
HSSFRow row = new HSSFRow(book, sheet, rownum);
addRow(row, true);
return row;
}
Create a new row within the sheet and return the high level representation |
public short getColumnWidth(short column) {
return sheet.getColumnWidth(column);
}
get the width (in units of 1/256th of a character width ) |
public short getDefaultColumnWidth() {
return sheet.getDefaultColumnWidth();
}
get the default column width for the sheet (if the columns do not define their own width) in
characters |
public short getDefaultRowHeight() {
return sheet.getDefaultRowHeight();
}
get the default row height for the sheet (if the rows do not define their own height) in
twips (1/20 of a point) |
public float getDefaultRowHeightInPoints() {
return (sheet.getDefaultRowHeight() / 20);
}
get the default row height for the sheet (if the rows do not define their own height) in
points. |
public int getFirstRowNum() {
return firstrow;
}
gets the first row on the sheet |
public int getLastRowNum() {
return lastrow;
}
gets the last row on the sheet |
public int getPhysicalNumberOfRows() {
return rows.size();
}
Returns the number of phsyically defined rows (NOT the number of rows in the sheet) |
public HSSFRow getPhysicalRowAt(int rownum) {
return ( HSSFRow ) rows.get(rownum);
}
Returns the row physically defined at (rownum). NOT the location on the sheet.
This is to say the row physically defined at location 5 might actually be 50 if
rows 0,2,25,30,40,50, 55 were the only rows on the sheet. |
public HSSFRow getRow(int rownum) {
for (int k = 0; k < rows.size(); k++)
{
HSSFRow row = ( HSSFRow ) rows.get(k);
if (row.getRowNum() == rownum)
{
return row;
}
}
return null;
}
Returns the logical row (not physical) 0-based. If you ask for a row that is not
defined you get a null. This is to say row 4 represents the fifth row on a sheet. |
public List getRows() {
// shallow copy, modifying cells changes things
// modifying the array changes nothing!
return ( ArrayList ) rows.clone();
}
get a List of the rows in this sheet. |
protected Sheet getSheet() {
return sheet;
}
used internally in the API to get the low level Sheet record represented by this
Object. |
public void removeRow(HSSFRow row) {
sheet.setLoc(sheet.getDimsLoc());
if (rows.size() > 0)
{
for (int k = (rows.size() - 1); k > -1; k--)
{
if (row.getRowNum() == (( HSSFRow ) rows.get(k)).getRowNum())
{
rows.remove(k);
if (row.getRowNum() == getLastRowNum())
{
lastrow = findLastRow(lastrow);
}
if (row.getRowNum() == getFirstRowNum())
{
firstrow = findFirstRow(firstrow);
}
break;
}
}
for (int k = 0; k < row.getPhysicalNumberOfCells(); k++)
{
sheet.removeValueRecord(row.getRowNum(),
row.getPhysicalCellAt(k)
.getCellValueRecord());
}
sheet.removeRow(row.getRowRecord());
}
}
Remove a row from this sheet. All cells contained in the row are removed as well |
public void setColumnWidth(short column,
short width) {
sheet.setColumnWidth(column, width);
}
set the width (in units of 1/256th of a character width) |
public void setDefaultColumnWidth(short width) {
sheet.setDefaultColumnWidth(width);
}
set the default column width for the sheet (if the columns do not define their own width) in
characters |
public void setDefaultRowHeight(short height) {
sheet.setDefaultRowHeight(height);
}
set the default row height for the sheet (if the rows do not define their own height) in
twips (1/20 of a point) |
public void setDefaultRowHeightInPoints(float height) {
sheet.setDefaultRowHeight(( short ) (height * 20));
}
set the default row height for the sheet (if the rows do not define their own height) in
points |