Class TextDoc
- java.lang.Object
-
- com.github.oowekyala.ooxml.messages.TextDoc
-
class TextDoc extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Integer>lineOffsetsThis list has one entry for each line, denoting the start offset of the line.private java.util.List<java.lang.String>linesprivate java.lang.StringsourceCodeprivate intsourceCodeLength
-
Constructor Summary
Constructors Constructor Description TextDoc(java.lang.String sourceCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcolumnFromOffset(int lineNumber, int offset)private intgetLineLengthWithLineSeparator(java.util.Scanner scanner)Sums the line length without the line separation and the characters which matched the line separation pattern(package private) ContextLinesgetLinesAround(@com.github.oowekyala.ooxml.messages.Annots.OneBased int line, int numLinesAround)java.lang.StringgetTextString()Returns the full source.intlineNumberFromOffset(int offset)
-
-
-
Field Detail
-
lineOffsets
private final java.util.List<java.lang.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 java.util.List<java.lang.String> lines
-
sourceCodeLength
private final int sourceCodeLength
-
sourceCode
private final java.lang.String sourceCode
-
-
Method Detail
-
getTextString
public java.lang.String getTextString()
Returns the full source.
-
getLinesAround
ContextLines getLinesAround(@com.github.oowekyala.ooxml.messages.Annots.OneBased int line, int numLinesAround)
-
getLineLengthWithLineSeparator
private int getLineLengthWithLineSeparator(java.util.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)
-
-