Class AbstractResultMatrix<T>

java.lang.Object
com.itextpdf.pdfua.checkers.utils.tables.AbstractResultMatrix<T>
Type Parameters:
T - The type of the cell.
Direct Known Subclasses:
CellResultMatrix, StructTreeResultMatrix

abstract class AbstractResultMatrix<T> extends Object
Class that represents a matrix of cells in a table. It is used to check if the table has valid headers and scopes for the cells.
  • Field Details

    • iterator

      protected final ITableIterator<T> iterator
    • cellMatrix

      private final List<T> cellMatrix
    • rows

      private final int rows
    • cols

      private final int cols
  • Constructor Details

    • AbstractResultMatrix

      protected AbstractResultMatrix(ITableIterator<T> iterator)
      Creates a new AbstractResultMatrix instance.
      Parameters:
      iterator - The iterator that will be used to iterate over the cells.
  • Method Details

    • checkValidTableTagging

      public void checkValidTableTagging()
      Runs the algorithm to check if the table has valid headers and scopes for the cells.
      Throws:
      PdfUAConformanceException - if the table doesn't have valid headers and scopes for the cells.
    • setRowValue

      private void setRowValue(int row, int rowSpan, List<Boolean> arr, boolean value)
    • getHeaders

      abstract List<byte[]> getHeaders(T cell)
    • getScope

      abstract String getScope(T cell)
    • getElementId

      abstract byte[] getElementId(T cell)
    • getRole

      abstract String getRole(T cell)
    • validateTableCells

      private void validateTableCells(Set<String> knownIds, List<Boolean> scopeMatrix, boolean hasUnknownHeaders)
    • getLocationInTable

      private String getLocationInTable(int row)
    • getNormalizedRow

      private int getNormalizedRow(int row)
    • setCell

      private <Z> void setCell(int row, int rowSpan, int col, int colSpan, List<Z> arr, Z value)
    • setColumnValue

      private void setColumnValue(int col, int colSpan, List<Boolean> arr, boolean value)
    • hasValidHeaderIds

      private boolean hasValidHeaderIds(T cell, Set<String> knownIds)
    • createFixedSizedList

      private static <Z> List<Z> createFixedSizedList(int capacity, Object defaultValue)