|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jrubyparser.SourcePosition
public class SourcePosition
Position within a source.
| Constructor Summary | |
|---|---|
SourcePosition()
Creates a default source position - required for serialization. |
|
SourcePosition(String file,
int startLine,
int endLine)
Creates a new source position. |
|
SourcePosition(String file,
int startLine,
int endLine,
int startOffset,
int endOffset)
Creates a new source position. |
|
| Method Summary | |
|---|---|
void |
adjustStartOffset(int relativeValue)
|
static SourcePosition |
combinePosition(SourcePosition firstPos,
SourcePosition secondPos)
Not used in interpreter Creates a new position the encloses both parameter positions. |
boolean |
equals(Object object)
|
SourcePosition |
fromBeginning(int length)
|
SourcePosition |
fromEnd(int length)
|
int |
getEndLine()
|
int |
getEndOffset()
|
String |
getFile()
|
int |
getStartLine()
|
int |
getStartOffset()
|
int |
hashCode()
Something we can use for identity in hashing, etc... |
boolean |
isEmpty()
Is this a place-holder element for things like a zero-arg listnode? These elements get added to the AST for that jruby-parser's rewriting can add arguments after the tree is constructed. |
boolean |
isWithin(int offset)
|
SourcePosition |
makeEmptyPositionAfterThis()
Make a new SourcePosition instance which will be the index starting at the end of this one of 0 length. |
SourcePosition |
makeEmptyPositionBeforeThis()
|
String |
toString()
|
SourcePosition |
union(SourcePosition other)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SourcePosition()
public SourcePosition(String file,
int startLine,
int endLine)
file - location of the source (must not be null)endLine - what line within the source
public SourcePosition(String file,
int startLine,
int endLine,
int startOffset,
int endOffset)
file - location of the source (must not be null)line - what line within the source| Method Detail |
|---|
public String getFile()
public int getStartLine()
public int getEndLine()
public boolean equals(Object object)
equals in class Objectobject - the object which should be compared
public int hashCode()
hashCode in class ObjectObject.hashCode()public String toString()
toString in class ObjectObject.toString()public void adjustStartOffset(int relativeValue)
public int getStartOffset()
public int getEndOffset()
public boolean isWithin(int offset)
public boolean isEmpty()
public SourcePosition union(SourcePosition other)
public SourcePosition fromEnd(int length)
public SourcePosition fromBeginning(int length)
public static SourcePosition combinePosition(SourcePosition firstPos,
SourcePosition secondPos)
the - positions providing the boundaries for the new position.public SourcePosition makeEmptyPositionAfterThis()
public SourcePosition makeEmptyPositionBeforeThis()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||