Class JsonText.Line

java.lang.Object
uk.blankaspect.common.json.JsonText.Line
All Implemented Interfaces:
ITextLine
Enclosing class:
JsonText

public class JsonText.Line extends Object implements ITextLine
This class encapsulates a line of text, which consists of a sequence of spans.
  • Method Details

    • text

      public String text()
      Returns the text of this line.
      Specified by:
      text in interface ITextLine
      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.
      Specified by:
      offset in interface ITextLine
      Returns:
      the offset from the start of the text to the start of this line.
    • spans

      public List<JsonText.Span> spans()
      Returns a list of the spans of text that are associated with this line.
      Specified by:
      spans in interface ITextLine
      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.
      Specified by:
      numSpans in interface ITextLine
      Returns:
      the number of spans of text that are associated with this line.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isEmpty

      public boolean isEmpty()
      Returns true 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.