com.meterware.httpunit
Class WebTable

java.lang.Object
  |
  +--com.meterware.httpunit.WebTable

public class WebTable
extends java.lang.Object

This class represents a table in an HTML page.

Author:
Russell Gold
, Benoit Xhenseval

Method Summary
 java.lang.String[][] asText()
          Returns a rendering of this table with all cells converted to text.
 java.lang.String getCell(int row, int column)
          Deprecated. use #getCellAsText
 java.lang.String getCellAsText(int row, int column)
          Returns the contents of the specified table cell as text.
 int getColumnCount()
          Returns the number of columns in the table.
 java.lang.String getID()
          Returns the unique ID attribute associated with this table.
 int getRowCount()
          Returns the number of rows in the table.
 java.lang.String getSummary()
          Returns the summary attribute associated with this table.
 TableCell getTableCell(int row, int column)
          Returns the contents of the specified table cell as text.
 TableCell getTableCellWithID(java.lang.String id)
          Returns the contents of the specified table cell with a given ID
 void purgeEmptyCells()
          Removes all rows and all columns from this table which have no visible text in them.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getRowCount

public int getRowCount()
Returns the number of rows in the table.


getColumnCount

public int getColumnCount()
Returns the number of columns in the table.


getCell

public java.lang.String getCell(int row,
                                int column)
Deprecated. use #getCellAsText

Returns the contents of the specified table cell as text. The row and column numbers are zero-based.

Throws:
java.lang.IndexOutOfBoundsException - if the specified cell numbers are not valid

getCellAsText

public java.lang.String getCellAsText(int row,
                                      int column)
Returns the contents of the specified table cell as text. The row and column numbers are zero-based.

Throws:
java.lang.IndexOutOfBoundsException - if the specified cell numbers are not valid

getTableCell

public TableCell getTableCell(int row,
                              int column)
Returns the contents of the specified table cell as text. The row and column numbers are zero-based.

Throws:
java.lang.IndexOutOfBoundsException - if the specified cell numbers are not valid

getTableCellWithID

public TableCell getTableCellWithID(java.lang.String id)
Returns the contents of the specified table cell with a given ID

Returns:
TableCell with given ID or null if ID is not found.

purgeEmptyCells

public void purgeEmptyCells()
Removes all rows and all columns from this table which have no visible text in them.


asText

public java.lang.String[][] asText()
Returns a rendering of this table with all cells converted to text.


getSummary

public java.lang.String getSummary()
Returns the summary attribute associated with this table.


getID

public java.lang.String getID()
Returns the unique ID attribute associated with this table.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Copyright © 2000-2002 Russell Gold. See license agreement for rights granted.