Class TextDoc

java.lang.Object
com.github.oowekyala.ooxml.messages.TextDoc

class TextDoc extends Object
  • Field Details

    • lineOffsets

      private final List<Integer> lineOffsets
      This list has one entry for each line, denoting the start offset of the line. The start offset of the next line includes the length of the line terminator (1 for \r|\n, 2 for \r\n).
    • lines

      private final List<String> lines
    • sourceCodeLength

      private final int sourceCodeLength
    • sourceCode

      private final String sourceCode
  • Constructor Details

    • TextDoc

      TextDoc(String sourceCode)
  • Method Details

    • getTextString

      public String getTextString()
      Returns the full source.
    • getLinesAround

      ContextLines getLinesAround(int line, int numLinesAround)
    • getLineLengthWithLineSeparator

      private int getLineLengthWithLineSeparator(Scanner scanner)
      Sums the line length without the line separation and the characters which matched the line separation pattern
      Parameters:
      scanner - the scanner from which to read the line's length
      Returns:
      the length of the line with the line separator.
    • lineNumberFromOffset

      public int lineNumberFromOffset(int offset)
    • columnFromOffset

      public int columnFromOffset(int lineNumber, int offset)