Package org.apache.fop.fo.flow.table
Class ColumnNumberManager
java.lang.Object
org.apache.fop.fo.flow.table.ColumnNumberManager
Helper class maintaining a record of occupied columns and an index to the next
non-occupied column.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private BitSet
We use the term "index" instead of "number" because, unlike column numbers, it's 0-based. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(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 columnsstart
toend
as occupied, and updates the number of the next available column.
-
Field Details
-
columnNumber
private int columnNumber -
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 columnsstart
toend
as occupied, and updates the number of the next available column.- Parameters:
start
- start number, inclusive, 1-basedend
- end number, inclusive
-
prepareForNextRow
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
-