class
Position
extends AnyRef
Instance Constructors
-
new
Position
()
Abstract Value Members
-
def
checkInput
(line: Int, column: Int): Unit
Concrete Value Members
-
def
!=
(arg0: AnyRef): Boolean
-
-
def
##
(): Int
-
def
==
(arg0: AnyRef): Boolean
-
-
val
COLUMN_BITS
: Int
-
val
COLUMN_MASK
: Int
-
val
LINE_BITS
: Int(20)
-
val
LINE_MASK
: Int
-
def
asInstanceOf
[T0]
: T0
-
def
clone
(): AnyRef
-
def
column
(pos: Int): Int
-
def
encode
(line: Int, column: Int): Int
-
def
eq
(arg0: AnyRef): Boolean
-
def
equals
(arg0: Any): Boolean
-
def
finalize
(): Unit
-
def
getClass
(): java.lang.Class[_]
-
def
hashCode
(): Int
-
def
isInstanceOf
[T0]
: Boolean
-
def
line
(pos: Int): Int
-
def
ne
(arg0: AnyRef): Boolean
-
def
notify
(): Unit
-
def
notifyAll
(): Unit
-
def
synchronized
[T0]
(arg0: ⇒ T0): T0
-
def
toString
(pos: Int): String
-
def
toString
(): String
-
def
wait
(): Unit
-
def
wait
(arg0: Long, arg1: Int): Unit
-
def
wait
(arg0: Long): Unit
Inherited from AnyRef
Value Members
-
def
!=
(arg0: AnyRef): Boolean
-
def
##
(): Int
-
def
==
(arg0: AnyRef): Boolean
-
def
clone
(): AnyRef
-
def
eq
(arg0: AnyRef): Boolean
-
def
equals
(arg0: Any): Boolean
-
def
finalize
(): Unit
-
def
getClass
(): java.lang.Class[_]
-
def
hashCode
(): Int
-
def
ne
(arg0: AnyRef): Boolean
-
def
notify
(): Unit
-
def
notifyAll
(): Unit
-
def
synchronized
[T0]
(arg0: ⇒ T0): T0
-
def
toString
(): String
-
def
wait
(): Unit
-
def
wait
(arg0: Long, arg1: Int): Unit
-
def
wait
(arg0: Long): Unit
Inherited from Any
Value Members
-
-
-
def
asInstanceOf
[T0]
: T0
-
def
isInstanceOf
[T0]
: Boolean
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)