Class/Object

cats.parse

LocationMap

Related Docs: object LocationMap | package parse

Permalink

class LocationMap extends AnyRef

This is a class to convert linear offset in a string into lines, or the column and line numbers.

This is useful for display to humans who in text editors think in terms of line and column numbers

Source
LocationMap.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LocationMap
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LocationMap(input: String)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  9. def getLine(i: Int): Option[String]

    Permalink

    return the line without a newline

  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  11. val input: String

    Permalink
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def isValidOffset(offset: Int): Boolean

    Permalink
  14. def lineCount: Int

    Permalink

    How many lines are there

  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toCaret(offset: Int): Option[Caret]

    Permalink
  20. def toCaretUnsafe(offset: Int): Caret

    Permalink

    Convert an offset to a Caret.

    Convert an offset to a Caret. throws IllegalArgumentException if offset is longer than input

  21. def toLineCol(offset: Int): Option[(Int, Int)]

    Permalink

    Given a string offset return the line and column If input.length is given (EOF) we return the same value as if the string were one character longer (i.e.

    Given a string offset return the line and column If input.length is given (EOF) we return the same value as if the string were one character longer (i.e. if we have appended a non-newline character at the EOF)

  22. def toOffset(line: Int, col: Int): Option[Int]

    Permalink

    Return the offset for a given line/col.

    Return the offset for a given line/col. if we return Some(input.length) this means EOF if we return Some(i) for 0 <= i < input.length it is a valid item else offset < 0 or offset > input.length we return None

  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped