FileDocCategorySizeDatePackage
SVTableModel.javaAPI DocApache Poi 3.0.12522Mon Jan 01 12:39:34 GMT 2007org.apache.poi.hssf.contrib.view

SVTableModel

public class SVTableModel extends AbstractTableModel
Sheet Viewer Table Model - The model for the Sheet Viewer just overrides things.
author
Andrew C. Oliver

Fields Summary
private HSSFSheet
st
int
maxcol
Constructors Summary
public SVTableModel(HSSFSheet st, int maxcol)


       
    this.st = st;
    this.maxcol=maxcol;
  
public SVTableModel(HSSFSheet st)

    this.st = st;
    Iterator i = st.rowIterator();

    while (i.hasNext()) {
      HSSFRow row = (HSSFRow)i.next();
      if (maxcol < (row.getLastCellNum()+1)) {
         this.maxcol = row.getLastCellNum();
      }
    }
  
Methods Summary
public java.lang.ClassgetColumnClass(int c)

	return HSSFCell.class;
  
public intgetColumnCount()

    return this.maxcol+1;
  
public intgetRowCount()

    return st.getLastRowNum() + 1;
  
public java.lang.ObjectgetValueAt(int row, int col)

    HSSFRow r = st.getRow(row);
    HSSFCell c = null;
    if (r != null) {
      c = r.getCell((short)col);
    }
    return c;
  
public booleanisCellEditable(int rowIndex, int columnIndex)

    return true;
  
public voidsetValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)

    if (aValue != null)
      System.out.println("SVTableModel.setValueAt. value type = "+aValue.getClass().getName());
    else System.out.println("SVTableModel.setValueAt. value type = null");