Class LineMap

java.lang.Object
org.jsoup.internal.LineMap

public final class LineMap extends Object
Maps source offsets to line and column coordinates. Jsoup internal; API subject to change.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a shared line map for tracked source ranges.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addLineStart(int pos)
    Records the source offset immediately after a newline.
    int
    columnNumber(int pos)
    Gets the 1-based column number for a source offset.
    void
    Trims the backing array after the parse has completed.
    int
    lineNumber(int pos)
    Gets the 1-based line number for a source offset.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LineMap

      public LineMap()
      Creates a shared line map for tracked source ranges.
  • Method Details

    • addLineStart

      public void addLineStart(int pos)
      Records the source offset immediately after a newline.
    • complete

      public void complete()
      Trims the backing array after the parse has completed.
    • lineNumber

      public int lineNumber(int pos)
      Gets the 1-based line number for a source offset.
    • columnNumber

      public int columnNumber(int pos)
      Gets the 1-based column number for a source offset.