Package uk.blankaspect.common.json
Class JsonText.Line
java.lang.Object
uk.blankaspect.common.json.JsonText.Line
- All Implemented Interfaces:
ITextLine
- Enclosing class:
JsonText
This class encapsulates a line of text, which consists of a sequence of spans.
-
Field Summary
Fields inherited from interface uk.blankaspect.common.text.ITextLine
OFFSET_COMPARATOR
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isEmpty()
Returnstrue
if this line is empty.void
Combines adjacent spans that are associated with the same token.int
numSpans()
Returns the number of spans of text that are associated with this line.int
offset()
Returns the offset from the start of the text to the start of this line.spans()
Returns a list of the spans of text that are associated with this line.text()
Returns the text of this line.toString()
-
Method Details
-
text
Returns the text of this line. -
offset
public int offset()Returns the offset from the start of the text to the start of this line. -
spans
Returns a list of the spans of text that are associated with this line. -
numSpans
public int numSpans()Returns the number of spans of text that are associated with this line. -
toString
-
isEmpty
public boolean isEmpty()Returnstrue
if this line is empty.- Returns:
true
if this line is empty.
-
normaliseSpans
public void normaliseSpans()Combines adjacent spans that are associated with the same token.
-