Class DelimitedTextRange

java.lang.Object
org.apache.fop.complexscripts.bidi.DelimitedTextRange

public class DelimitedTextRange extends Object
The DelimitedTextRange class implements the "delimited text range" as described by XML-FO 1.1 ยง5.8, which contains a flattened sequence of characters. Any FO that generates block areas serves as a delimiter.

This work was originally authored by Glenn Adams (gadams@apache.org).

  • Field Details

    • fn

      private FONode fn
    • buffer

      private StringBuffer buffer
    • intervals

      private List intervals
    • log

      private static final org.apache.commons.logging.Log log

      Assign resolved levels to a specified text interval over this delimited text range.

      Returns a list of text intervals containing either (1) the single, input text interval or (2) two or more new text intervals obtained from sub-dividing the input text range into level runs, i.e., runs of text assigned to a single level.

  • Constructor Details

    • DelimitedTextRange

      public DelimitedTextRange(FONode fn)
      Primary constructor.
      Parameters:
      fn - node that generates this text range
  • Method Details

    • getNode

      public FONode getNode()
      Obtain node that generated this text range.
      Returns:
      node that generated this text range
    • append

      public void append(CharIterator it, FONode fn)
      Append interval using characters from character iterator IT.
      Parameters:
      it - character iterator
      fn - node that generates interval being appended
    • append

      public void append(char c, FONode fn)
      Append interval using character C.
      Parameters:
      c - character
      fn - node that generates interval being appended
    • isEmpty

      public boolean isEmpty()
      Determine if range is empty.
      Returns:
      true if range is empty
    • resolve

      public void resolve()
      Resolve bidirectional levels for this range.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • resolve

      private void resolve(Direction paragraphEmbeddingLevel)
    • assignLevels

      private void assignLevels(int[] levels)

      Assign resolved levels to all text intervals of this delimited text range.

      Has a possible side effect of replacing the intervals array with a new array containing new text intervals, such that each text interval is associated with a single level run.

      Parameters:
      levels - array of levels each corresponding to each index of the delimited text range
    • assignLevels

      private List assignLevels(TextInterval ti, int[] levels)
    • assignTextLevels

      private void assignTextLevels()

      Assign resolved levels for each interval to source #PCDATA in the associated FOText.

    • assignBlockLevel

      private void assignBlockLevel(Direction paragraphEmbeddingLevel)
    • assignBlockLevel

      private void assignBlockLevel(FONode node, int defaultLevel)