org.gcube.portlets.d4sreporting.common.server.serializables
Class TableModel

java.lang.Object
  extended by org.gcube.portlets.d4sreporting.common.server.serializables.TableModel
All Implemented Interfaces:
Serializable

public class TableModel
extends Object
implements Serializable

TableModel class represent a template component that can be JAVA (Not GWT) serializable

Version:
October 2009 (1.4)
Author:
Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
See Also:
Serialized Form

Constructor Summary
TableModel()
          default constructor
TableModel(int colsNo)
          actual one
 
Method Summary
 boolean addRow(ArrayList<String> row)
          Gets the ArrayList of Strings row in the specified row.
protected  void checkCellBounds(int row, int column)
          Bounds checks that the cell exists at the specified location.
protected  void checkRowBounds(int row)
          Checks that the row is within the correct bounds.
 int getCellCount(int row)
           
 int getColsNo()
           
 int getRowCount()
           
 List<ArrayList<String>> getTable()
           
 String getValue(int row, int column)
          Gets the value in the specified cell.
 void setColsNo(int colsNo)
           
 void setTable(List<ArrayList<String>> table)
           
 String toString()
          to String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableModel

public TableModel()
default constructor


TableModel

public TableModel(int colsNo)
actual one

Parameters:
colsNo - the number of columns of the table
Method Detail

addRow

public boolean addRow(ArrayList<String> row)
Gets the ArrayList of Strings row in the specified row.

Parameters:
row - the table's row
Returns:
true if ok, exception if the row cells are different from the cols No of the table
Throws:
IllegalArgumentException

getValue

public String getValue(int row,
                       int column)
Gets the value in the specified cell.

Parameters:
row - the cell's row
column - the cell's column
Returns:
the String in the specified cell, or null if none is present
Throws:
IndexOutOfBoundsException

checkCellBounds

protected void checkCellBounds(int row,
                               int column)
Bounds checks that the cell exists at the specified location.

Parameters:
row - cell's row
column - cell's column
Throws:
IndexOutOfBoundsException

checkRowBounds

protected void checkRowBounds(int row)
Checks that the row is within the correct bounds.

Parameters:
row - row index to check
Throws:
IndexOutOfBoundsException

getRowCount

public int getRowCount()
Returns:
.

getCellCount

public int getCellCount(int row)
Parameters:
row - .
Returns:
.

getColsNo

public int getColsNo()
Returns:
.

setColsNo

public void setColsNo(int colsNo)
Parameters:
colsNo - .

getTable

public List<ArrayList<String>> getTable()
Returns:
.

setTable

public void setTable(List<ArrayList<String>> table)
Parameters:
table - .

toString

public String toString()
to String

Overrides:
toString in class Object
Returns:
the string representin gthe table


Copyright © 2013. All Rights Reserved.