fop 2.0

org.apache.fop.layoutmgr
Class ElementListUtils

java.lang.Object
  extended by org.apache.fop.layoutmgr.ElementListUtils

public final class ElementListUtils
extends java.lang.Object

Utilities for Knuth element lists.


Method Summary
static int calcContentLength(java.util.List elems)
          Calculates the content length of the given element list.
static int calcContentLength(java.util.List elems, int start, int end)
          Calculates the content length of the given element list.
static int determinePreviousBreak(java.util.List elems, int startIndex)
          Determines the position of the previous break before the start index on an element list.
static boolean endsWithForcedBreak(java.util.List elems)
          Indicates whether the given element list ends with a forced break.
static boolean endsWithNonInfinitePenalty(java.util.List elems)
          Indicates whether the given element list ends with a penalty with a non-infinite penalty value.
static boolean isEmptyBox(java.util.List elements)
           
static boolean removeLegalBreaks(java.util.List elements, int constraint)
          Removes legal breaks in an element list.
static boolean removeLegalBreaks(java.util.List elements, MinOptMax constraint)
          Removes legal breaks in an element list.
static boolean removeLegalBreaksFromEnd(java.util.List elements, int constraint)
          Removes legal breaks in an element list.
static boolean startsWithForcedBreak(java.util.List elems)
          Indicates whether the given element list starts with a forced break.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

removeLegalBreaks

public static boolean removeLegalBreaks(java.util.List elements,
                                        MinOptMax constraint)
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 list
constraint - 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

public static boolean removeLegalBreaks(java.util.List elements,
                                        int constraint)
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 list
constraint - value to restrict the range in which the breaks are removed.
Returns:
true if the constraint is bigger than the list contents

removeLegalBreaksFromEnd

public static boolean removeLegalBreaksFromEnd(java.util.List elements,
                                               int constraint)
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 list
constraint - value to restrict the range in which the breaks are removed.
Returns:
true if the constraint is bigger than the list contents

calcContentLength

public static int calcContentLength(java.util.List elems,
                                    int start,
                                    int end)
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
start - element at which to start
end - element at which to stop
Returns:
the content length

calcContentLength

public static int calcContentLength(java.util.List elems)
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

public static boolean endsWithForcedBreak(java.util.List elems)
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

public static boolean startsWithForcedBreak(java.util.List elems)
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

public static boolean endsWithNonInfinitePenalty(java.util.List elems)
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

public static int determinePreviousBreak(java.util.List elems,
                                         int startIndex)
Determines the position of the previous break before the start index on an element list.

Parameters:
elems - the element list
startIndex - the start index
Returns:
the position of the previous break, or -1 if there was no previous break

isEmptyBox

public static boolean isEmptyBox(java.util.List elements)

fop 2.0

Copyright 1999-2015 The Apache Software Foundation. All Rights Reserved.