Package cruise.umple.parser
Class Position
java.lang.Object
cruise.umple.parser.Position
public class Position
extends java.lang.Object
Used to indicate the coordinates of a position when parsing. This is done by keeping track of the
filename, the line number and the corresponding offset on that line number.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Position
add(Position more)
Position
copy()
void
delete()
boolean
equals(java.lang.Object obj)
int
getCharacterOffset()
The character offset of the position.java.lang.String
getFilename()
The filename of the position.int
getLineNum()
extract the line number of the positionint
getLineNumber()
The line number of the position.int
getOffset()
The offset of the position.int
hashCode()
boolean
setCharacterOffset(int aCharacterOffset)
boolean
setFilename(java.lang.String aFilename)
boolean
setLineNumber(int aLineNumber)
boolean
setOffset(int aOffset)
java.lang.String
toString()
-
Constructor Details
-
Method Details
-
setFilename
public boolean setFilename(java.lang.String aFilename) -
setLineNumber
public boolean setLineNumber(int aLineNumber) -
setCharacterOffset
public boolean setCharacterOffset(int aCharacterOffset) -
setOffset
public boolean setOffset(int aOffset) -
getFilename
public java.lang.String getFilename()The filename of the position. -
getLineNumber
public int getLineNumber()The line number of the position. -
getCharacterOffset
public int getCharacterOffset()The character offset of the position. -
getOffset
public int getOffset()The offset of the position. -
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
delete
public void delete() -
copy
-
add
-
getLineNum
public int getLineNum()extract the line number of the position -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-