Class TableCellIterator
- java.lang.Object
-
- com.itextpdf.pdfua.checkers.utils.tables.TableCellIterator
-
- All Implemented Interfaces:
ITableIterator<Cell>
final class TableCellIterator extends java.lang.Object implements ITableIterator<Cell>
Class that iterates over the cells of a table.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<IElement>children(package private) PdfUAValidationContextcontextprivate CellcurrentCellprivate TableCellIteratorfooterIteratorprivate TableCellIteratorheaderIteratorprivate intindexprivate PdfNamelocationprivate Tabletable
-
Constructor Summary
Constructors Constructor Description TableCellIterator(Table table, PdfUAValidationContext context)Creates a newTableCellIteratorinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAmountOfRowsBody()Gets the number of rows in the body of the table.intgetAmountOfRowsFooter()Gets the number of rows in the footer of the table.intgetAmountOfRowsHeader()Gets the number of rows in the header of the table.intgetCol()Gets the column index of current position.intgetColspan()Gets the colspan of the current positionprivate PdfNamegetLocation()intgetNumberOfColumns()Returns the amount of columns the table has.intgetRow()Gets the row index of the current position.intgetRowspan()Gets the rowspan of current position.booleanhasNext()Checks if there is a next element in the iteration.Cellnext()Gets the next element in the iteration.
-
-
-
Field Detail
-
context
final PdfUAValidationContext context
-
children
private java.util.List<IElement> children
-
index
private int index
-
headerIterator
private TableCellIterator headerIterator
-
footerIterator
private TableCellIterator footerIterator
-
table
private Table table
-
location
private PdfName location
-
currentCell
private Cell currentCell
-
-
Constructor Detail
-
TableCellIterator
public TableCellIterator(Table table, PdfUAValidationContext context)
Creates a newTableCellIteratorinstance.- Parameters:
table- the table that will be iterated.context- the validation context.
-
-
Method Detail
-
hasNext
public boolean hasNext()
Checks if there is a next element in the iteration.- Specified by:
hasNextin interfaceITableIterator<Cell>- Returns:
trueif there is a next element,falseotherwise
-
next
public Cell next()
Gets the next element in the iteration.- Specified by:
nextin interfaceITableIterator<Cell>- Returns:
- the next element
-
getAmountOfRowsBody
public int getAmountOfRowsBody()
Gets the number of rows in the body of the table.- Specified by:
getAmountOfRowsBodyin interfaceITableIterator<Cell>- Returns:
- the number of rows in the body of the table
-
getAmountOfRowsHeader
public int getAmountOfRowsHeader()
Gets the number of rows in the header of the table.- Specified by:
getAmountOfRowsHeaderin interfaceITableIterator<Cell>- Returns:
- the number of rows in the header of the table
-
getAmountOfRowsFooter
public int getAmountOfRowsFooter()
Gets the number of rows in the footer of the table.- Specified by:
getAmountOfRowsFooterin interfaceITableIterator<Cell>- Returns:
- the number of rows in the footer of the table
-
getNumberOfColumns
public int getNumberOfColumns()
Returns the amount of columns the table has. All rows in a table in UA specification must have the same column count. So return the max column count for correctly generated error messages.- Specified by:
getNumberOfColumnsin interfaceITableIterator<Cell>- Returns:
- the amount of columns
-
getRow
public int getRow()
Gets the row index of the current position.- Specified by:
getRowin interfaceITableIterator<Cell>- Returns:
- the row index
-
getCol
public int getCol()
Gets the column index of current position.- Specified by:
getColin interfaceITableIterator<Cell>- Returns:
- the column index
-
getRowspan
public int getRowspan()
Gets the rowspan of current position.- Specified by:
getRowspanin interfaceITableIterator<Cell>- Returns:
- the rowspan
-
getColspan
public int getColspan()
Gets the colspan of the current position- Specified by:
getColspanin interfaceITableIterator<Cell>- Returns:
- the colspan of current position
-
getLocation
private PdfName getLocation()
-
-