Class 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.
    • Constructor Detail

      • 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 Detail

      • 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()