Class AbstractResultMatrix<T>

  • Type Parameters:
    T - the type of the cell
    Direct Known Subclasses:
    CellResultMatrix, StructTreeResultMatrix

    abstract class AbstractResultMatrix<T>
    extends java.lang.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.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void checkValidTableTagging()
      Runs the algorithm to check if the table has valid headers and scopes for the cells.
      private static <Z> java.util.List<Z> createFixedSizedList​(int capacity, java.lang.Object defaultValue)  
      private void determineDefaultScope​(int rowIdx, int rowspan, int colIdx, int colspan, java.util.List<java.lang.Boolean> scopeMatrix)  
      (package private) abstract byte[] getElementId​(T cell)  
      (package private) abstract java.util.List<byte[]> getHeaders​(T cell)  
      private java.lang.String getLocationInTable​(int row)  
      private int getNormalizedRow​(int row)  
      (package private) abstract java.lang.String getRole​(T cell)  
      (package private) abstract java.lang.String getScope​(T cell)  
      private boolean hasValidHeaderIds​(T cell, java.util.Set<java.lang.String> knownIds)  
      private <Z> void setCell​(int row, int rowSpan, int col, int colSpan, java.util.List<Z> arr, Z value)  
      private void setColumnValue​(int col, int colSpan, java.util.List<java.lang.Boolean> arr, boolean value)  
      private void setRowAndColumnValue​(int row, int rowSpan, int col, int colSpan, java.util.List<java.lang.Boolean> arr, boolean value)  
      private void setRowValue​(int row, int rowSpan, java.util.List<java.lang.Boolean> arr, boolean value)  
      private void validateTableCells​(java.util.Set<java.lang.String> knownIds, java.util.List<java.lang.Boolean> scopeMatrix, boolean hasUnknownHeaders)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cellMatrix

        private final java.util.List<T> cellMatrix
      • rows

        private final int rows
      • cols

        private final int cols
    • Method Detail

      • 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.
      • getHeaders

        abstract java.util.List<byte[]> getHeaders​(T cell)
      • getScope

        abstract java.lang.String getScope​(T cell)
      • getElementId

        abstract byte[] getElementId​(T cell)
      • getRole

        abstract java.lang.String getRole​(T cell)
      • determineDefaultScope

        private void determineDefaultScope​(int rowIdx,
                                           int rowspan,
                                           int colIdx,
                                           int colspan,
                                           java.util.List<java.lang.Boolean> scopeMatrix)
      • validateTableCells

        private void validateTableCells​(java.util.Set<java.lang.String> knownIds,
                                        java.util.List<java.lang.Boolean> scopeMatrix,
                                        boolean hasUnknownHeaders)
      • getLocationInTable

        private java.lang.String getLocationInTable​(int row)
      • getNormalizedRow

        private int getNormalizedRow​(int row)
      • setCell

        private <Z> void setCell​(int row,
                                 int rowSpan,
                                 int col,
                                 int colSpan,
                                 java.util.List<Z> arr,
                                 Z value)
      • setRowValue

        private void setRowValue​(int row,
                                 int rowSpan,
                                 java.util.List<java.lang.Boolean> arr,
                                 boolean value)
      • setColumnValue

        private void setColumnValue​(int col,
                                    int colSpan,
                                    java.util.List<java.lang.Boolean> arr,
                                    boolean value)
      • setRowAndColumnValue

        private void setRowAndColumnValue​(int row,
                                          int rowSpan,
                                          int col,
                                          int colSpan,
                                          java.util.List<java.lang.Boolean> arr,
                                          boolean value)
      • hasValidHeaderIds

        private boolean hasValidHeaderIds​(T cell,
                                          java.util.Set<java.lang.String> knownIds)
      • createFixedSizedList

        private static <Z> java.util.List<Z> createFixedSizedList​(int capacity,
                                                                  java.lang.Object defaultValue)