Package org.apache.fop.text.linebreak
Class LineBreakStatus
java.lang.Object
org.apache.fop.text.linebreak.LineBreakStatus
This class is meant for supporting the Unicode line breaking algorithm.
See: UTR 14
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
Constant indicating a Combining Indirect Breakstatic final byte
Constant indicating a Combining Prohibited Breakstatic final byte
Constant indicating a Direct Breakstatic final byte
Constant indicating a Explicit Breakstatic final byte
Constant indicating an Indirect Breakstatic final byte
Constant indicating a Prohibited Break -
Constructor Summary
ConstructorDescriptionResets the class to the same state as if new LineBreakStatus() had just been called. -
Method Summary
Modifier and TypeMethodDescriptionbyte
nextChar
(char c) Check whether a line break may happen according to the rules described in the Unicode Line Breaking Algorithm.void
reset()
Reset the status.
-
Field Details
-
DIRECT_BREAK
public static final byte DIRECT_BREAKConstant indicating a Direct Break- See Also:
-
INDIRECT_BREAK
public static final byte INDIRECT_BREAKConstant indicating an Indirect Break- See Also:
-
COMBINING_INDIRECT_BREAK
public static final byte COMBINING_INDIRECT_BREAKConstant indicating a Combining Indirect Break- See Also:
-
COMBINING_PROHIBITED_BREAK
public static final byte COMBINING_PROHIBITED_BREAKConstant indicating a Combining Prohibited Break- See Also:
-
PROHIBITED_BREAK
public static final byte PROHIBITED_BREAKConstant indicating a Prohibited Break- See Also:
-
EXPLICIT_BREAK
public static final byte EXPLICIT_BREAKConstant indicating a Explicit Break- See Also:
-
-
Constructor Details
-
LineBreakStatus
public LineBreakStatus()Resets the class to the same state as if new LineBreakStatus() had just been called.
-
-
Method Details
-
reset
public void reset()Reset the status. This method will reset the status to the initial state. It is meant for recycling objects. -
nextChar
public byte nextChar(char c) Check whether a line break may happen according to the rules described in the Unicode Line Breaking Algorithm. The function returns the line breaking status of the point before the given character. The algorithm is the table-driven algorithm, as described in Unicode Technical Report #14. The pair table is taken fromLineBreakUtils
. TODO: Better handling for AI, SA, SG and XX line break classes.- Parameters:
c
- the character to check- Returns:
- the break action to be taken
one of:
DIRECT_BREAK
,INDIRECT_BREAK
,COMBINING_INDIRECT_BREAK
,COMBINING_PROHIBITED_BREAK
,PROHIBITED_BREAK
,EXPLICIT_BREAK
-