public final class StringSourcePosition extends java.lang.Object implements SourcePosition
Constructor and Description |
---|
StringSourcePosition(java.lang.String string,
int line,
int column)
Construct a string source position.
|
Modifier and Type | Method and Description |
---|---|
int |
getColumn()
Get the column number of the position.
|
Identifier |
getIdentifier()
Get identifier registered with denoted position.
|
int |
getLength()
Get number of characters from current position to end of line.
|
int |
getLine()
Get the line number of the position.
|
int |
getOffset()
Get offset of denoted position
|
Source |
getSource()
Get the source file.
|
java.lang.String |
getSourceLine()
Get source line corresponding to position.
|
void |
setIdentifier(Identifier ident)
Register identifier with denoted position.
|
java.lang.String |
toString()
Get printable text representation of position.
|
public StringSourcePosition(java.lang.String string, int line, int column)
string
- the stringline
- the line number.column
- the column number.public Source getSource()
getSource
in interface SourcePosition
public int getLine()
getLine
in interface SourcePosition
public int getColumn()
getColumn
in interface SourcePosition
public int getOffset()
getOffset
in interface SourcePosition
public int getLength()
getLength
in interface SourcePosition
public java.lang.String toString()
toString
in interface SourcePosition
toString
in class java.lang.Object
public java.lang.String getSourceLine()
getSourceLine
in interface SourcePosition
public void setIdentifier(Identifier ident)
setIdentifier
in interface SourcePosition
ident
- the identifier to be registered.public Identifier getIdentifier()
getIdentifier
in interface SourcePosition