Package spoon.reflect.cu.position
Class NoSourcePosition
java.lang.Object
spoon.reflect.cu.position.NoSourcePosition
- All Implemented Interfaces:
- Serializable,- SourcePosition
- Direct Known Subclasses:
- PartialSourcePositionImpl
This class represents the position of a program element in a source file.
- See Also:
- Serialized Form
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields inherited from interface spoon.reflect.cu.SourcePositionNOPOSITION
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintGets the column in the source file (1 indexed).Gets the compilation unit for this position.intGets the end column in the source file (1 indexed).intGets the end line in the source file (1 indexed).getFile()Gets the file for this position.intgetLine()Gets the line in the source file (1 indexed).intGets the index at which the position ends in the source file.intGets the index at which the position starts in the source file.booleantoString()Returns a string representation of this position in the form "sourcefile:line", or "sourcefile" if no line number is available.
- 
Constructor Details- 
NoSourcePositionpublic NoSourcePosition()
 
- 
- 
Method Details- 
getFileDescription copied from interface:SourcePositionGets the file for this position.- Specified by:
- getFilein interface- SourcePosition
 
- 
getCompilationUnitDescription copied from interface:SourcePositionGets the compilation unit for this position.- Specified by:
- getCompilationUnitin interface- SourcePosition
 
- 
isValidPositionpublic boolean isValidPosition()- Specified by:
- isValidPositionin interface- SourcePosition
- Returns:
- true if this instance holds start/end indexes of related sources. false if they are unknown
 
- 
getLinepublic int getLine()Description copied from interface:SourcePositionGets the line in the source file (1 indexed). Prefer usingSourcePosition.getSourceStart()}. For CtNamedElement the line is where the name is declared.- Specified by:
- getLinein interface- SourcePosition
 
- 
getEndLinepublic int getEndLine()Description copied from interface:SourcePositionGets the end line in the source file (1 indexed). Prefer usingSourcePosition.getSourceEnd()}.- Specified by:
- getEndLinein interface- SourcePosition
 
- 
getColumnpublic int getColumn()Description copied from interface:SourcePositionGets the column in the source file (1 indexed). This method is slow because it has to calculate the column number depending onEnvironment.getTabulationSize()andCtCompilationUnit.getOriginalSourceCode(). PreferSourcePosition.getSourceStart().- Specified by:
- getColumnin interface- SourcePosition
 
- 
getEndColumnpublic int getEndColumn()Description copied from interface:SourcePositionGets the end column in the source file (1 indexed). This method is slow because it has to calculate the column number depending onEnvironment.getTabulationSize()andCtCompilationUnit.getOriginalSourceCode(). PreferSourcePosition.getSourceEnd().- Specified by:
- getEndColumnin interface- SourcePosition
 
- 
getSourceEndpublic int getSourceEnd()Description copied from interface:SourcePositionGets the index at which the position ends in the source file. Heavily used for the sniper mode.- Specified by:
- getSourceEndin interface- SourcePosition
 
- 
getSourceStartpublic int getSourceStart()Description copied from interface:SourcePositionGets the index at which the position starts in the source file.- Specified by:
- getSourceStartin interface- SourcePosition
 
- 
toStringDescription copied from interface:SourcePositionReturns a string representation of this position in the form "sourcefile:line", or "sourcefile" if no line number is available.- Specified by:
- toStringin interface- SourcePosition
- Overrides:
- toStringin class- Object
 
 
-