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
- Alphabetic
- By Inheritance
- LocationMap
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new LocationMap(input: String)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getLine(i: Int): Option[String]
return the line without a newline
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val input: String
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isValidOffset(offset: Int): Boolean
- def lineCount: Int
How many lines are there
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toCaret(offset: Int): Option[Caret]
- def toCaretUnsafe(offset: Int): Caret
Convert an offset to a Caret.
Convert an offset to a Caret. throws IllegalArgumentException if offset is longer than input
- def toLineCol(offset: Int): Option[(Int, Int)]
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)
- def toOffset(line: Int, col: Int): Option[Int]
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
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()