Package org.apache.fop.layoutmgr
Class ElementListUtils
java.lang.Object
org.apache.fop.layoutmgr.ElementListUtils
Utilities for Knuth element lists.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intcalcContentLength(List elems) Calculates the content length of the given element list.static intcalcContentLength(List<ListElement> elems, int start, int end) Calculates the content length of the given element list.static intdeterminePreviousBreak(List<ListElement> elems, int startIndex) Determines the position of the previous break before the start index on an element list.static booleanendsWithForcedBreak(List<ListElement> elems) Indicates whether the given element list ends with a forced break.static booleanIndicates whether the given element list ends with a penalty with a non-infinite penalty value.static booleanisEmptyBox(List elements) static booleanremoveLegalBreaks(List<ListElement> elements, MinOptMax constraint) Removes legal breaks in an element list.static booleanremoveLegalBreaks(List elements, int constraint) Removes legal breaks in an element list.static booleanremoveLegalBreaksFromEnd(List elements, int constraint) Removes legal breaks in an element list.static booleanstartsWithForcedBreak(List<ListElement> elems) Indicates whether the given element list starts with a forced break.
-
Method Details
-
removeLegalBreaks
Removes legal breaks in an element list. A constraint can be specified to limit the range in which the breaks are removed. Legal breaks occuring before at least constraint.opt space is filled will be removed.- Parameters:
elements- the element listconstraint- min/opt/max value to restrict the range in which the breaks are removed.- Returns:
- true if the opt constraint is bigger than the list contents
-
removeLegalBreaks
Removes legal breaks in an element list. A constraint can be specified to limit the range in which the breaks are removed. Legal breaks occuring before at least constraint space is filled will be removed.- Parameters:
elements- the element listconstraint- value to restrict the range in which the breaks are removed.- Returns:
- true if the constraint is bigger than the list contents
-
removeLegalBreaksFromEnd
Removes legal breaks in an element list. A constraint can be specified to limit the range in which the breaks are removed. Legal breaks within the space specified through the constraint (starting from the end of the element list) will be removed.- Parameters:
elements- the element listconstraint- value to restrict the range in which the breaks are removed.- Returns:
- true if the constraint is bigger than the list contents
-
calcContentLength
Calculates the content length of the given element list. Warning: It doesn't take any stretch and shrink possibilities into account.- Parameters:
elems- the element liststart- element at which to startend- element at which to stop- Returns:
- the content length
-
calcContentLength
Calculates the content length of the given element list. Warning: It doesn't take any stretch and shrink possibilities into account.- Parameters:
elems- the element list- Returns:
- the content length
-
endsWithForcedBreak
Indicates whether the given element list ends with a forced break.- Parameters:
elems- the element list- Returns:
- true if the list ends with a forced break
-
startsWithForcedBreak
Indicates whether the given element list starts with a forced break.- Parameters:
elems- the element list- Returns:
- true if the list starts with a forced break
-
endsWithNonInfinitePenalty
Indicates whether the given element list ends with a penalty with a non-infinite penalty value.- Parameters:
elems- the element list- Returns:
- true if the list ends with a non-infinite penalty
-
determinePreviousBreak
Determines the position of the previous break before the start index on an element list.- Parameters:
elems- the element liststartIndex- the start index- Returns:
- the position of the previous break, or -1 if there was no previous break
-
isEmptyBox
-