Class ColumnNumberManager

java.lang.Object
org.apache.fop.fo.flow.table.ColumnNumberManager

public class ColumnNumberManager extends Object
Helper class maintaining a record of occupied columns and an index to the next non-occupied column.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
     
    private BitSet
    We use the term "index" instead of "number" because, unlike column numbers, it's 0-based.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) int
    Returns the number of the column that shall receive the next parsed cell.
    boolean
    isColumnNumberUsed(int colNr)
    Checks whether a given column-number is already in use for the current row.
    (package private) void
    prepareForNextRow(List pendingSpans)
    Resets the record of occupied columns, taking into account columns already occupied by previous spanning cells, and computes the number of the first free column.
    (package private) void
    signalUsedColumnNumbers(int start, int end)
    Flags columns start to end as occupied, and updates the number of the next available column.

    Methods inherited from class java.lang.Object

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

    • columnNumber

      private int columnNumber
    • usedColumnIndices

      private BitSet usedColumnIndices
      We use the term "index" instead of "number" because, unlike column numbers, it's 0-based.
  • Constructor Details

    • ColumnNumberManager

      public ColumnNumberManager()
  • Method Details

    • getCurrentColumnNumber

      int getCurrentColumnNumber()
      Returns the number of the column that shall receive the next parsed cell.
      Returns:
      a column number, 1-based
    • signalUsedColumnNumbers

      void signalUsedColumnNumbers(int start, int end)
      Flags columns start to end as occupied, and updates the number of the next available column.
      Parameters:
      start - start number, inclusive, 1-based
      end - end number, inclusive
    • prepareForNextRow

      void prepareForNextRow(List pendingSpans)
      Resets the record of occupied columns, taking into account columns already occupied by previous spanning cells, and computes the number of the first free column.
      Parameters:
      pendingSpans - List<PendingSpan> of possible spans over the next row
    • isColumnNumberUsed

      public boolean isColumnNumberUsed(int colNr)
      Checks whether a given column-number is already in use for the current row.
      Parameters:
      colNr - the column-number to check
      Returns:
      true if column-number is already occupied