|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.compiler.TokenReference
This class defines objets that hold a reference to a file and a position in the file.
| Field Summary | |
private String |
cachedName
The name of the file referred to by this token, calculated lazily. |
private int |
column
|
private static int |
DEF_COLUMN
The default column number when none is specified |
private File |
file
|
private static TokenReference |
last
|
private int |
line
|
static TokenReference |
NO_REF
|
static String |
UNKNOWN
|
| Constructor Summary | |
private |
TokenReference(File file,
int line)
Construct a file and line reference |
private |
TokenReference(File file,
int line,
int column)
Construct a file, line, and column reference |
| Method Summary | |
static TokenReference |
build(File file,
int line)
Construct a file and line reference |
static TokenReference |
build(File file,
int line,
int column)
Construct a file, line, and column reference. |
int |
column()
Returns the column number of reference |
File |
file()
Returns the file to which this token reference refers. |
int |
line()
Returns the line number of reference |
String |
name()
Returns the short file name of this reference (without any path name). |
private String |
relativeFilePath()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String UNKNOWN
public static TokenReference NO_REF
private static TokenReference last
private static final int DEF_COLUMN
private final File file
private final int line
private final int column
private String cachedName
private invariant (* cachedName != null ==> name() == cachedName *);
String.intern()| Constructor Detail |
private TokenReference(File file,
int line)
file - the fileline - the line number
private TokenReference(File file,
int line,
int column)
file - the fileline - the line number| Method Detail |
public static TokenReference build(File file,
int line)
file - the fileline - the line number
WARNING: DOES NOT LIKE MULTITHREADING
public static TokenReference build(File file,
int line,
int column)
file - the fileline - the line numbercolumn - the column number
WARNING: DOES NOT LIKE MULTITHREADINGpublic final File file()
public final String name()
assignable cachedName; ensures file() != null ==> \result.equals(file().getName()); ensures file() == null ==> \result == UNKNOWN;
public final int line()
public final int column()
public String toString()
toString in class Objectprivate String relativeFilePath()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||