|
|||||||||
| Home >> All >> com >> arthurdo >> [ parser overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.arthurdo.parser
Class Table

java.lang.Objectcom.arthurdo.parser.Table
- public class Table
- extends java.lang.Object
Null Cells and Phantom Rows
elementAt() can return null if there is no cell at the requested coordinate due to spans across areas where there are no cells, for example,
<table>
<tr><td rowspan=2>abc<td>def
</table>
In this case, calling elementAt(1, 1) would return null. Similarly, getRowTag() could return null if the requested index is a phantom row (a row that doesn't have any real cells). In the example above, the table has two rows due to the rowspan but row 1 is a phantom row and does not have a <tr> tag.
Implementation Note: the table parser is very strict, that is, <TABLE> can only contain <TR>. <TR> can only contain <TD>. Any deviation from this nesting is considered bad data and will be thrown away by the parser. In a future release, we hope to be more forgiving.
- 02/09/98 Dr. Jaron Collis, added support for
and introduced a parseTable(Reader) convenience function. - Version:
- 0.9 01/32/98
Field Summary private TableCellm_cell
private TableCell[][]m_elements
private booleanm_pushback
private java.util.Vectorm_row
private java.util.Vectorm_rows
private java.util.Vectorm_rowTags
private java.lang.StringBufferm_stringValue
private HtmlTagm_tableTag
private HtmlStreamTokenizerm_tok
private intm_tokenType
private java.lang.StringBufferm_whiteSpace
Constructor Summary Table()
Method Summary private voidaddToCell(java.lang.Object o)
private voidbeginCell(HtmlTag tag)
TableCellelementAt(int row, int col)
private voidendCell()
intgetColumns()
intgetRows()
HtmlTaggetRowTag(int row)
private java.lang.StringBuffergetStringValue()
HtmlTaggetTableTag()
private intgetTokenType()
private java.lang.StringBuffergetWhiteSpace()
private voidnewRow()
private intnextToken()
private voidorganizeRowCol()
private booleanparseCol()
private booleanparseRow()
voidparseTable(HtmlStreamTokenizer tokenizer, HtmlTag tableTag)
voidparseTable(java.io.InputStream in)
Deprecated. use parseTable(Reader) instead. This version of the constructor can lead to 10x slower code because of the InputStreamReader wrapper.voidparseTable(java.io.Reader in)
private voidpushBackToken()
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitField Detail m_tok
private HtmlStreamTokenizer m_tok
m_pushback
private boolean m_pushback
m_tokenType
private int m_tokenType
m_stringValue
private java.lang.StringBuffer m_stringValue
m_whiteSpace
private java.lang.StringBuffer m_whiteSpace
m_cell
private TableCell m_cell
m_row
private java.util.Vector m_row
m_rows
private java.util.Vector m_rows
m_elements
private TableCell[][] m_elements
m_tableTag
private HtmlTag m_tableTag
m_rowTags
private java.util.Vector m_rowTags
Constructor Detail Table
public Table()
Method Detail parseTable
public void parseTable(java.io.InputStream in) throws HtmlException, java.io.IOException
- Deprecated. use parseTable(Reader) instead.
This version of the constructor can lead to 10x slower code
because of the InputStreamReader wrapper.
parseTable
public void parseTable(java.io.Reader in) throws HtmlException, java.io.IOException
parseTable
public void parseTable(HtmlStreamTokenizer tokenizer, HtmlTag tableTag) throws HtmlException, java.io.IOException
getTableTag
public HtmlTag getTableTag()
getRowTag
public HtmlTag getRowTag(int row)
getRows
public int getRows()
getColumns
public int getColumns()
elementAt
public TableCell elementAt(int row, int col)
organizeRowCol
private void organizeRowCol() throws HtmlException
parseRow
private boolean parseRow() throws java.io.IOException
parseCol
private boolean parseCol() throws java.io.IOException
newRow
private void newRow()
beginCell
private void beginCell(HtmlTag tag)
endCell
private void endCell()
addToCell
private void addToCell(java.lang.Object o)
nextToken
private int nextToken() throws java.io.IOException
pushBackToken
private void pushBackToken() throws java.io.IOException
getTokenType
private int getTokenType()
getStringValue
private java.lang.StringBuffer getStringValue()
getWhiteSpace
private java.lang.StringBuffer getWhiteSpace()
Overview Package Class Use Deprecated Index Home >> All >> com >> arthurdo >> [ parser overview ] PREV CLASS NEXT CLASS SUMMARY:
JAVADOC |
SOURCE |
DOWNLOAD | NESTED | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
com.arthurdo.parser.Table