1 package spoon.reflect.declaration; 2 3 import java.io.File; 4 5 /** 6 * This interface represents the position of a program element in a source file. 7 */ 8 public interface SourcePosition extends Cloneable { 9 10 /** 11 * Returns a string representation of this position in the form 12 * "sourcefile:line", or "sourcefile" if no line number is available. 13 */ 14 String toString(); 15 16 /** 17 * Gets the source file (path is relative to the working directory). 18 */ 19 File getFile(); 20 21 /** 22 * Gets the line in the source file. 23 */ 24 int getLine(); 25 26 /** 27 * Gets the column in the source file. 28 */ 29 int getColumn(); 30 31 /** 32 * Clones this position. 33 */ 34 Object clone() throws CloneNotSupportedException; 35 36 /** 37 * Gets the index at which the position ends in the source file. 38 */ 39 int getSourceEnd(); 40 41 /** 42 * Gets the index at which the position starts in the source file. 43 */ 44 int getSourceStart(); 45 46 47 } 48