Class Table

java.lang.Object
com.extractpdf4j.helpers.Table

public class Table extends Object
Table

Immutable-style value object describing a rectangular grid of cell text along with the column/row boundary positions (in pixel or point units depending on the parser). Cell lists are defensively copied on construction.

  • Constructor Details

  • Method Details

    • nrows

      public int nrows()
      Number of rows in the table.
    • ncols

      public int ncols()
      Number of columns in the table (0 if there are no rows).
    • cell

      public String cell(int r, int c)
      Returns the cell value at row r, column c.
    • setCell

      public void setCell(int r, int c, String v)
      Mutates the cell at row r, column c with value v.
    • asList

      public List<List<String>> asList()
      Returns an unmodifiable deep copy view of the cells. Each inner row list is unmodifiable to prevent external mutation.
    • toCSV

      public String toCSV(char sep)
      Serializes the table to CSV using the given separator. Fields containing the separator, double quotes, or newlines are quoted; embedded quotes are escaped as a pair of quotes. No trailing newline is added.
    • getColBoundaries

      public List<Double> getColBoundaries()
    • getRowBoundaries

      public List<Double> getRowBoundaries()