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 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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<T>
cellMatrix
private int
cols
protected ITableIterator<T>
iterator
private int
rows
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractResultMatrix(ITableIterator<T> iterator)
Creates a newAbstractResultMatrix
instance.
-
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)
(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
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)
-
-
-
Field Detail
-
iterator
protected final ITableIterator<T> iterator
-
cellMatrix
private final java.util.List<T> cellMatrix
-
rows
private final int rows
-
cols
private final int cols
-
-
Constructor Detail
-
AbstractResultMatrix
protected AbstractResultMatrix(ITableIterator<T> iterator)
Creates a newAbstractResultMatrix
instance.- Parameters:
iterator
- The iterator that will be used to iterate over the cells.
-
-
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.
-
setRowValue
private void setRowValue(int row, int rowSpan, java.util.List<java.lang.Boolean> arr, boolean value)
-
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)
-
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)
-
setColumnValue
private void setColumnValue(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)
-
-