in scala.io
object Position

object Position
extends java.lang.Object
with ScalaObject
convenience methods to encode line and column number in one single integer. The encode line (column) numbers range from 0 to LINE_MASK (COLUMN_MASK), where 0 indicates that the line (column) is the 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)
author:
Burak Emir (translated from work by Matthias Zengers and others)

Constructor Summary
def this



Def Summary
final def column ( pos : scala.Int ) : scala.Int
Returns the column number of the encoded position.
final def encode ( line : scala.Int , column : scala.Int ) : scala.Int
Encodes a position into a single integer.
final def line ( pos : scala.Int ) : scala.Int
Returns the line number of the encoded position.
def toString ( pos : scala.Int ) : java.lang.String
Returns a string representation of the encoded position.


Constructor Detail
def this

Def Detail
final def column ( pos : scala.Int ) : scala.Int
Returns the column number of the encoded position.

final def encode ( line : scala.Int , column : scala.Int ) : scala.Int
Encodes a position into a single integer.

final def line ( pos : scala.Int ) : scala.Int
Returns the line number of the encoded position.

def toString ( pos : scala.Int ) : java.lang.String
Returns a string representation of the encoded position.