Package uk.blankaspect.common.text
Interface ITextLine
- All Known Implementing Classes:
JsonText.Line
public interface ITextLine
This interface defines the methods that must be implemented by a class that represents a line of text.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator
<ITextLine> A comparator that compares two lines by the offset from the start of the text to the start of the line. -
Method Summary
Modifier and TypeMethodDescriptiondefault int
Returns the offset from the start of the text to the exclusive end of this line (that is, the character immediately after the end of this line).default int
length()
Returns the length of this line.default 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.
-
Field Details
-
OFFSET_COMPARATOR
A comparator that compares two lines by the offset from the start of the text to the start of the line.
-
-
Method Details
-
text
String text()Returns the text of this line.- Returns:
- the text of this line.
-
offset
int offset()Returns the offset from the start of the text to the start of this line.- Returns:
- the offset from the start of the text to the start of this line.
-
endOffset
default int endOffset()Returns the offset from the start of the text to the exclusive end of this line (that is, the character immediately after the end of this line).- Returns:
- the offset from the start of the text to the exclusive end of this line.
-
length
default int length()Returns the length of this line.- Returns:
- the length of this line.
-
spans
Returns a list of the spans of text that are associated with this line.- Returns:
- a list of the spans of text that are associated with this line.
-
numSpans
default int numSpans()Returns the number of spans of text that are associated with this line.- Returns:
- the number of spans of text that are associated with this line.
-