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

    Fields
    Modifier and Type
    Field
    Description
    static 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 Type
    Method
    Description
    default 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
    Returns the length of this line.
    default int
    Returns the number of spans of text that are associated with this line.
    int
    Returns the offset from the start of the text to the start of this line.
    List<? extends ITextSpan>
    Returns a list of the spans of text that are associated with this line.
    Returns the text of this line.
  • Field Details

    • OFFSET_COMPARATOR

      static final Comparator<ITextLine> 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

      List<? extends ITextSpan> 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.