Class TextDocumentPart

java.lang.Object
com.pnfsoftware.jeb.core.output.text.impl.TextDocumentPart
All Implemented Interfaces:
ITextDocumentPart

public class TextDocumentPart extends Object implements ITextDocumentPart
A simple implementation for a text document part.
  • Field Details

    • EMPTY

      public static final TextDocumentPart EMPTY
      An empty part with an empty line and an anchor pointing to that line
  • Constructor Details

    • TextDocumentPart

      public TextDocumentPart(List<ILine> lines, List<IAnchor> anchors)
      Create a new part with the given lines and anchors.
      Parameters:
      lines - a list of lines
      anchors - a list of anchors
  • Method Details

    • getLines

      public List<ILine> getLines()
      Description copied from interface: ITextDocumentPart
      Get the lines within that part. The lines may span over one or more anchors.
      Specified by:
      getLines in interface ITextDocumentPart
      Returns:
      the list of lines
    • getLine

      public ILine getLine(int index)
      Description copied from interface: ITextDocumentPart
      Get a line by part-relative index.
      Specified by:
      getLine in interface ITextDocumentPart
      Parameters:
      index - line index within this part
      Returns:
      the requested line
    • getCountOfLines

      public int getCountOfLines()
      Description copied from interface: ITextDocumentPart
      Get the number of lines in this part.
      Specified by:
      getCountOfLines in interface ITextDocumentPart
      Returns:
      the line count
    • getAnchors

      public List<IAnchor> getAnchors()
      Description copied from interface: ITextDocumentPart
      Get the anchors within that part. The last anchor object may be used to specify the first anchor id of the next, contiguous part. It is especially useful in cases where a line spans multiple anchor ids.
      Specified by:
      getAnchors in interface ITextDocumentPart
      Returns:
      the list of anchors
    • getAnchor

      public IAnchor getAnchor(int index)
      Description copied from interface: ITextDocumentPart
      Get an anchor by part-relative index.
      Specified by:
      getAnchor in interface ITextDocumentPart
      Parameters:
      index - anchor index within this part
      Returns:
      the requested anchor
    • getCountOfAnchors

      public int getCountOfAnchors()
      Description copied from interface: ITextDocumentPart
      Get the number of anchors contained in this part.
      Specified by:
      getCountOfAnchors in interface ITextDocumentPart
      Returns:
      the anchor count