Package org.apache.fop.fo.flow.table
Class ColumnNumberManager
- java.lang.Object
-
- org.apache.fop.fo.flow.table.ColumnNumberManager
-
public class ColumnNumberManager extends java.lang.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
columnNumber
private java.util.BitSet
usedColumnIndices
We use the term "index" instead of "number" because, unlike column numbers, it's 0-based.
-
Constructor Summary
Constructors Constructor Description ColumnNumberManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
getCurrentColumnNumber()
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(java.util.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 columnsstart
toend
as occupied, and updates the number of the next available column.
-
-
-
Method Detail
-
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 columnsstart
toend
as occupied, and updates the number of the next available column.- Parameters:
start
- start number, inclusive, 1-basedend
- end number, inclusive
-
prepareForNextRow
void prepareForNextRow(java.util.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
-
-