Class Position

java.lang.Object
io.deephaven.web.shared.ide.lsp.Position
All Implemented Interfaces:
Serializable

@JsType(namespace="dh.lsp") public class Position extends Object implements Serializable
A position within a text document. This is a JS-exposed model type (dh.lsp.Position) that closely follows the Language Server Protocol position shape.
See Also:
  • Field Details

    • line

      public int line
      The zero-based line offset.
    • character

      public int character
      The zero-based character offset within the line.
  • Constructor Details

    • Position

      public Position()
    • Position

      @JsIgnore public Position(Position source)
    • Position

      @JsIgnore public Position(int line, int character)
    • Position

      @JsIgnore public Position(jsinterop.base.JsPropertyMap<Object> source)
  • Method Details

    • toString

      @JsIgnore public String toString()
      Overrides:
      toString in class Object
    • equals

      @JsIgnore public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      @JsIgnore public int hashCode()
      Overrides:
      hashCode in class Object
    • lessThan

      public boolean lessThan(Position start)
      Checks if this position is strictly less than start (lexicographically by line then character).
      Parameters:
      start - the position to compare against
      Returns:
      true if this position is before start
    • lessOrEqual

      public boolean lessOrEqual(Position start)
      Checks if this position is less than or equal to start (lexicographically by line then character).
      Parameters:
      start - the position to compare against
      Returns:
      true if this position is before or equal to start
    • greaterThan

      public boolean greaterThan(Position end)
      Checks if this position is strictly greater than end (lexicographically by line then character).
      Parameters:
      end - the position to compare against
      Returns:
      true if this position is after end
    • greaterOrEqual

      public boolean greaterOrEqual(Position end)
      Checks if this position is greater than or equal to end (lexicographically by line then character).
      Parameters:
      end - the position to compare against
      Returns:
      true if this position is after or equal to end
    • extend

      @JsIgnore public int extend(Position requested)
    • plus

      @JsIgnore public Position plus(int line, int character)
    • minus

      @JsIgnore public Position minus(int line, int character)
    • copy

      public Position copy()
      Creates a copy of this position.
      Returns:
      a new Position with the same line and character