|
mjc | ||||||||||
| 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 java.lang.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 java.io.File |
file
|
private static TokenReference |
last
|
private int |
line
|
static TokenReference |
NO_REF
|
static java.lang.String |
UNKNOWN
|
| Constructor Summary | |
private |
TokenReference(java.io.File file,
int line)
Construct a file and line reference |
private |
TokenReference(java.io.File file,
int line,
int column)
Construct a file, line, and column reference |
| Method Summary | |
static TokenReference |
build(java.io.File file,
int line)
Construct a file and line reference |
static TokenReference |
build(java.io.File file,
int line,
int column)
Construct a file, line, and column reference. |
int |
column()
Returns the column number of reference |
java.io.File |
file()
Returns the file to which this token reference refers. |
int |
line()
Returns the line number of reference |
java.lang.String |
name()
Returns the short file name of this reference (without any path name). |
private java.lang.String |
relativeFilePath()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String UNKNOWN
public static TokenReference NO_REF
private static TokenReference last
private static final int DEF_COLUMN
private final java.io.File file
private final int line
private final int column
private java.lang.String cachedName
private invariant (* cachedName != null ==> name() == cachedName *);
String.intern()| Constructor Detail |
private TokenReference(java.io.File file,
int line)
file - the fileline - the line number
private TokenReference(java.io.File file,
int line,
int column)
file - the fileline - the line number| Method Detail |
public static TokenReference build(java.io.File file,
int line)
file - the fileline - the line number
WARNING: DOES NOT LIKE MULTITHREADING
public static TokenReference build(java.io.File file,
int line,
int column)
file - the fileline - the line numbercolumn - the column number
WARNING: DOES NOT LIKE MULTITHREADINGpublic final java.io.File file()
public final java.lang.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 java.lang.String toString()
toString in class java.lang.Objectprivate java.lang.String relativeFilePath()
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||