Class TableCellIterator

java.lang.Object
com.itextpdf.pdfua.checkers.utils.tables.TableCellIterator
All Implemented Interfaces:
ITableIterator<Cell>

final class TableCellIterator extends Object implements ITableIterator<Cell>
Class that iterates over the cells of a table.
  • Field Details

  • Constructor Details

    • TableCellIterator

      public TableCellIterator(Table table, PdfUAValidationContext context)
      Creates a new TableCellIterator instance.
      Parameters:
      table - the table that will be iterated.
      context - the validation context.
  • Method Details

    • hasNext

      public boolean hasNext()
      Checks if there is a next element in the iteration.
      Specified by:
      hasNext in interface ITableIterator<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 interface ITableIterator<Cell>
      Returns:
      The next element.
    • getAmountOfRowsBody

      public int getAmountOfRowsBody()
      Gets the number of rows in the body of the table.
      Specified by:
      getAmountOfRowsBody in interface ITableIterator<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 interface ITableIterator<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 interface ITableIterator<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 interface ITableIterator<Cell>
      Returns:
      the amount of columns
    • getRow

      public int getRow()
      Gets the row index of the current position.
      Specified by:
      getRow in interface ITableIterator<Cell>
      Returns:
      The row index.
    • getCol

      public int getCol()
      Gets the column index of current position.
      Specified by:
      getCol in interface ITableIterator<Cell>
      Returns:
      The column index.
    • getRowspan

      public int getRowspan()
      Gets the rowspan of current position.
      Specified by:
      getRowspan in interface ITableIterator<Cell>
      Returns:
      the rowspan
    • getColspan

      public int getColspan()
      Gets the colspan of the current position
      Specified by:
      getColspan in interface ITableIterator<Cell>
      Returns:
      the colspan of current position
    • getLocation

      private PdfName getLocation()