Package org.htmlunit.html
Class HtmlTable.RowIterator
- java.lang.Object
-
- org.htmlunit.html.HtmlTable.RowIterator
-
- All Implemented Interfaces:
java.lang.Iterable<HtmlTableRow>
,java.util.Iterator<HtmlTableRow>
- Enclosing class:
- HtmlTable
private class HtmlTable.RowIterator extends java.lang.Object implements java.util.Iterator<HtmlTableRow>, java.lang.Iterable<HtmlTableRow>
An iterator that moves over all rows in this table. The iterator will also enter into nested row group elements (header, footer and body).
-
-
Field Summary
Fields Modifier and Type Field Description private TableRowGroup
currentGroup_
private HtmlTableRow
nextRow_
-
Constructor Summary
Constructors Constructor Description RowIterator()
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
java.util.Iterator<HtmlTableRow>
iterator()
HtmlTableRow
next()
HtmlTableRow
nextRow()
void
remove()
Removes the current row from the underlying table.private void
setNextRow(DomNode node)
Sets the internal position to the next row, starting at the given node.
-
-
-
Field Detail
-
nextRow_
private HtmlTableRow nextRow_
-
currentGroup_
private TableRowGroup currentGroup_
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<HtmlTableRow>
- Returns:
true
if there are more rows available
-
next
public HtmlTableRow next() throws java.util.NoSuchElementException
- Specified by:
next
in interfacejava.util.Iterator<HtmlTableRow>
- Returns:
- the next row from this iterator
- Throws:
java.util.NoSuchElementException
- if no more rows are available
-
remove
public void remove()
Removes the current row from the underlying table.- Specified by:
remove
in interfacejava.util.Iterator<HtmlTableRow>
-
nextRow
public HtmlTableRow nextRow() throws java.util.NoSuchElementException
- Returns:
- the next row from this iterator
- Throws:
java.util.NoSuchElementException
- if no more rows are available
-
setNextRow
private void setNextRow(DomNode node)
Sets the internal position to the next row, starting at the given node.- Parameters:
node
- the node to mark as the next row; if this is not a row, the next reachable row will be marked.
-
iterator
public java.util.Iterator<HtmlTableRow> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<HtmlTableRow>
-
-