Package org.htmlunit.html
Class HtmlTableRow.CellIterator
- java.lang.Object
-
- org.htmlunit.html.HtmlTableRow.CellIterator
-
- All Implemented Interfaces:
java.lang.Iterable<HtmlTableCell>
,java.util.Iterator<HtmlTableCell>
- Enclosing class:
- HtmlTableRow
public class HtmlTableRow.CellIterator extends java.lang.Object implements java.util.Iterator<HtmlTableCell>, java.lang.Iterable<HtmlTableCell>
An Iterator over the HtmlTableCells contained in this row. It will also dive into nested forms, even though that is illegal HTML.
-
-
Field Summary
Fields Modifier and Type Field Description private HtmlForm
currentForm_
private HtmlTableCell
nextCell_
-
Constructor Summary
Constructors Constructor Description CellIterator()
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
java.util.Iterator<HtmlTableCell>
iterator()
Returns an HtmlTableCell iterator.HtmlTableCell
next()
HtmlTableCell
nextCell()
void
remove()
Removes the cell under the cursor from the current row.private void
setNextCell(DomNode node)
Sets the internal position to the next cell, starting at the given node
-
-
-
Field Detail
-
nextCell_
private HtmlTableCell nextCell_
-
currentForm_
private HtmlForm currentForm_
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<HtmlTableCell>
- Returns:
- whether there is another cell available
-
next
public HtmlTableCell next() throws java.util.NoSuchElementException
- Specified by:
next
in interfacejava.util.Iterator<HtmlTableCell>
- Returns:
- the next cell
- Throws:
java.util.NoSuchElementException
- if no cell is available
-
remove
public void remove()
Removes the cell under the cursor from the current row.- Specified by:
remove
in interfacejava.util.Iterator<HtmlTableCell>
-
nextCell
public HtmlTableCell nextCell() throws java.util.NoSuchElementException
- Returns:
- the next cell
- Throws:
java.util.NoSuchElementException
- if no cell is available
-
setNextCell
private void setNextCell(DomNode node)
Sets the internal position to the next cell, starting at the given node- Parameters:
node
- the node to mark as the next cell; if this is not a cell, the next reachable cell will be marked.
-
iterator
public java.util.Iterator<HtmlTableCell> iterator()
Returns an HtmlTableCell iterator.- Specified by:
iterator
in interfacejava.lang.Iterable<HtmlTableCell>
- Returns:
- an HtmlTableCell Iterator.
-
-