|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jruby.lexer.yacc.IDESourcePosition
public class IDESourcePosition
Position within a source. This could have column as well, but it currently does not. A normal ruby intrepretter does not use this information in error/warning information. An IDE using this may need it though. This is trivially added if need be.
ISourcePosition,
Serialized Form| Constructor Summary | |
|---|---|
IDESourcePosition()
Creates a default source position - required for serialization. |
|
IDESourcePosition(java.lang.String file,
int startLine,
int endLine)
Creates a new source position. |
|
IDESourcePosition(java.lang.String file,
int startLine,
int endLine,
int startOffset,
int endOffset)
Creates a new source position. |
|
| Method Summary | |
|---|---|
void |
adjustStartOffset(int relativeValue)
Modify startOffset by a relativeValue. |
static IDESourcePosition |
combinePosition(ISourcePosition firstPos,
ISourcePosition secondPos)
Not used in interpreter Creates a new position the encloses both parameter positions. |
boolean |
equals(java.lang.Object object)
|
java.util.Collection<CommentNode> |
getComments()
Get comments associated with this position (really we get this from node, but this is a hack to save some space when using the interpreter). |
int |
getEndLine()
Which is the last(end) line that this source position occurs on (zero-based) |
int |
getEndOffset()
Not used in interpreter |
java.lang.String |
getFile()
Which file does this source position live in? |
int |
getStartLine()
Not used in interpreter |
int |
getStartOffset()
Not used in interpreter |
int |
hashCode()
Something we can use for identity in hashing, etc... |
void |
setComments(java.util.Collection<CommentNode> comments)
|
java.lang.String |
toString()
|
ISourcePosition |
union(ISourcePosition other)
Calculates the logical union of the two positions and creates a new resulting position |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IDESourcePosition()
public IDESourcePosition(java.lang.String file,
int startLine,
int endLine)
file - location of the source (must not be null)endLine - what line within the source
public IDESourcePosition(java.lang.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 java.lang.String getFile()
ISourcePosition
getFile in interface ISourcePositionISourcePosition.getFile()public int getStartLine()
getStartLine in interface ISourcePositionISourcePosition.getStartLine()public int getEndLine()
ISourcePosition
getEndLine in interface ISourcePositionISourcePosition.getEndLine()public boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - the object which should be compared
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public void adjustStartOffset(int relativeValue)
ISourcePosition
adjustStartOffset in interface ISourcePositionrelativeValue - to nudge startOffset up or downISourcePosition.adjustStartOffset(int)public int getStartOffset()
getStartOffset in interface ISourcePositionISourcePosition.getStartOffset()public int getEndOffset()
getEndOffset in interface ISourcePositionISourcePosition.getEndOffset()public ISourcePosition union(ISourcePosition other)
ISourcePosition
union in interface ISourcePositionother - to be unioned against this position
ISourcePosition.union(ISourcePosition)
public static IDESourcePosition combinePosition(ISourcePosition firstPos,
ISourcePosition secondPos)
the - positions providing the boundaries for the new position.public java.util.Collection<CommentNode> getComments()
ISourcePosition
getComments in interface ISourcePositionpublic void setComments(java.util.Collection<CommentNode> comments)
setComments in interface ISourcePosition
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||