scala.io

Position

abstract class Position extends AnyRef

The object Position provides convenience methods to encode line and column number in one single integer. The encoded line (column) numbers range from 0 to LINE_MASK (COLUMN_MASK), where 0 indicates that the line (column) is undefined and 1 represents the first line (column).

Line (Column) numbers greater than LINE_MASK (COLUMN_MASK) are replaced by LINE_MASK (COLUMN_MASK). Furthermore, if the encoded line number is LINE_MASK, the column number is always set to 0.

The following properties hold:

the undefined position is 0: encode(0,0) == 0 encodings are non-negative : encode(line,column) >= 0 position order is preserved:

(line1 <= line2) || (line1 == line2 && column1 <= column2)

implies

encode(line1,column1) <= encode(line2,column2)
Annotations
@deprecated
Deprecated

(Since version 2.10.0) This class will be removed.

Source
Position.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Position
  2. AnyRef
  3. Any
Implicitly
  1. by StringAdd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Position()

Abstract Value Members

  1. abstract def checkInput(line: Int, column: Int): Unit

    Definable behavior for overflow conditions.

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from Position to StringAdd[Position] performed by method StringAdd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (Position, B)

    Implicit information
    This member is added by an implicit conversion from Position to ArrowAssoc[Position] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final val COLUMN_BITS: Int

    Number of bits used to encode the column number

  9. final val COLUMN_MASK: Int

    Mask to decode the column number

  10. final val LINE_BITS: Int(20)

    Number of bits used to encode the line number

  11. final val LINE_MASK: Int

    Mask to decode the line number

  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. final def column(pos: Int): Int

    Returns the column number of the encoded position.

  15. final def encode(line: Int, column: Int): Int

    Encodes a position into a single integer.

  16. def ensuring(cond: (Position) ⇒ Boolean, msg: ⇒ Any): Position

    Implicit information
    This member is added by an implicit conversion from Position to Ensuring[Position] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: (Position) ⇒ Boolean): Position

    Implicit information
    This member is added by an implicit conversion from Position to Ensuring[Position] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean, msg: ⇒ Any): Position

    Implicit information
    This member is added by an implicit conversion from Position to Ensuring[Position] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean): Position

    Implicit information
    This member is added by an implicit conversion from Position to Ensuring[Position] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  22. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  23. def formatted(fmtstr: String): String

    Returns string formatted according to given format string.

    Returns string formatted according to given format string. Format strings are as for String.format (@see java.lang.String.format).

    Implicit information
    This member is added by an implicit conversion from Position to StringFormat[Position] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  24. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  25. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  26. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  27. final def line(pos: Int): Int

    Returns the line number of the encoded position.

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

    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  32. def toString(pos: Int): String

    Returns a string representation of the encoded position.

  33. def toString(): String

    Definition Classes
    AnyRef → Any
  34. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  35. final def wait(arg0: Long, arg1: Int): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. def [B](y: B): (Position, B)

    Implicit information
    This member is added by an implicit conversion from Position to ArrowAssoc[Position] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion StringAdd from Position to StringAdd[Position]

Inherited by implicit conversion StringFormat from Position to StringFormat[Position]

Inherited by implicit conversion Ensuring from Position to Ensuring[Position]

Inherited by implicit conversion ArrowAssoc from Position to ArrowAssoc[Position]

Ungrouped