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) PdfUAValidationContext
context
private Cell
currentCell
private TableCellIterator
footerIterator
private TableCellIterator
headerIterator
private int
index
private PdfName
location
private Table
table
-
Constructor Summary
Constructors Constructor Description TableCellIterator(Table table, PdfUAValidationContext context)
Creates a newTableCellIterator
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAmountOfRowsBody()
Gets the number of rows in the body of the table.int
getAmountOfRowsFooter()
Gets the number of rows in the footer of the table.int
getAmountOfRowsHeader()
Gets the number of rows in the header of the table.int
getCol()
Gets the column index of current position.int
getColspan()
Gets the colspan of the current positionprivate PdfName
getLocation()
int
getNumberOfColumns()
Returns the amount of columns the table has.int
getRow()
Gets the row index of the current position.int
getRowspan()
Gets the rowspan of current position.boolean
hasNext()
Checks if there is a next element in the iteration.Cell
next()
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 newTableCellIterator
instance.- 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:
hasNext
in interfaceITableIterator<Cell>
- Returns:
true
if there is a next element,false
otherwise.
-
next
public Cell next()
Gets the next element in the iteration.- Specified by:
next
in interfaceITableIterator<Cell>
- Returns:
- The next element.
-
getAmountOfRowsBody
public int getAmountOfRowsBody()
Gets the number of rows in the body of the table.- Specified by:
getAmountOfRowsBody
in 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:
getAmountOfRowsHeader
in 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:
getAmountOfRowsFooter
in 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:
getNumberOfColumns
in interfaceITableIterator<Cell>
- Returns:
- the amount of columns
-
getRow
public int getRow()
Gets the row index of the current position.- Specified by:
getRow
in interfaceITableIterator<Cell>
- Returns:
- The row index.
-
getCol
public int getCol()
Gets the column index of current position.- Specified by:
getCol
in interfaceITableIterator<Cell>
- Returns:
- The column index.
-
getRowspan
public int getRowspan()
Gets the rowspan of current position.- Specified by:
getRowspan
in interfaceITableIterator<Cell>
- Returns:
- the rowspan
-
getColspan
public int getColspan()
Gets the colspan of the current position- Specified by:
getColspan
in interfaceITableIterator<Cell>
- Returns:
- the colspan of current position
-
getLocation
private PdfName getLocation()
-
-