FileDocCategorySizeDatePackage
TableIterator.javaAPI DocApache Poi 3.0.12067Mon Jan 01 18:55:30 GMT 2007org.apache.poi.hwpf.usermodel

TableIterator

public class TableIterator extends Object

Fields Summary
Range
_range
int
_index
int
_levelNum
Constructors Summary
TableIterator(Range range, int levelNum)

    _range = range;
    _index = 0;
    _levelNum = levelNum;
  
public TableIterator(Range range)

    this(range, 1);
  
Methods Summary
public booleanhasNext()

    int numParagraphs = _range.numParagraphs();
    for (;_index < numParagraphs; _index++)
    {
      Paragraph paragraph = _range.getParagraph(_index);
      if (paragraph.isInTable() && paragraph.getTableLevel() == _levelNum)
      {
        return true;
      }
    }
    return false;
  
public org.apache.poi.hwpf.usermodel.Tablenext()

    int numParagraphs = _range.numParagraphs();
    int numRows = 0;
    int startIndex = _index;
    int endIndex = _index;

    for (;_index < numParagraphs; _index++)
    {
      Paragraph paragraph = _range.getParagraph(_index);
      if (!paragraph.isInTable() || paragraph.getTableLevel() < _levelNum)
      {
        endIndex = _index;
        break;
      }
    }
    return new Table(startIndex, endIndex, _range, _levelNum);