|
ESC/Java2 © 2003,2004,2005,2006 David Cok and Joseph Kiniry © 2005,2006 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavafe.ast.ASTNode
javafe.ast.Name
Treated as an immutable type.
Invariant: There is always at least one element in a Name.
| Field Summary | |
protected static java.lang.String[] |
emptyStringArray
Avoid allocating more than one of these. |
| Fields inherited from class javafe.ast.ASTNode |
bogusField, dotCounter, dotId |
| Constructor Summary | |
protected |
Name()
|
| Method Summary | |
void |
check()
|
abstract boolean |
equals(java.lang.Object other)
Return true if other is a Name that
is component-wise equal to this. |
int |
getEndLoc()
Override getEndLoc so it refers to the actual end of us. |
abstract int |
hashCode()
Return a hash code for this such that two
Names that are equals have the same
hash code. |
abstract Identifier |
identifierAt(int i)
Return the ith identifier of this. |
abstract int |
locDotAfter(int i)
Return the location of the dot after the ith identifier of this. |
abstract int |
locIdAt(int i)
Return the location of the ith identifier of this. |
static Name |
make(int[] locIds,
int[] locDots,
IdentifierVec ids)
Make a Name with the given identifiers and
locations. |
static Name |
make(java.lang.String N,
int loc)
Make a Name whose locations are all
loc from a String.
|
abstract Name |
prefix(int len)
Return a Name consisting of the first
len identifiers of this. |
abstract java.lang.String |
printName()
Return our printname, which will be of one of the forms X, X.Y, X.Y.Z, ... |
abstract int |
size()
Return the number of identifiers in this. |
java.lang.String[] |
toStrings()
Return all identifiers in this in an array. |
abstract java.lang.String[] |
toStrings(int len)
Return the first len identifiers in
this in an array. |
| Methods inherited from class javafe.ast.ASTNode |
accept, accept, childAt, childCount, clone, clone, getDecorations, getStartLoc, getTag, isInternal, setDecorations, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final java.lang.String[] emptyStringArray
| Constructor Detail |
protected Name()
| Method Detail |
public abstract java.lang.String printName()
public abstract int hashCode()
this such that two
Names that are equals have the same
hash code.
public abstract boolean equals(java.lang.Object other)
other is a Name that
is component-wise equal to this.
public abstract int size()
this.
public abstract Identifier identifierAt(int i)
this.
public abstract int locIdAt(int i)
this.
public abstract int locDotAfter(int i)
this.
public abstract java.lang.String[] toStrings(int len)
len identifiers in
this in an array. Requires that len
be between 0 and length of this inclusive.
public java.lang.String[] toStrings()
this in an array.
public static Name make(int[] locIds,
int[] locDots,
IdentifierVec ids)
Name with the given identifiers and
locations. Caller must forget about the Vecs/arrays passed
here.
public static Name make(java.lang.String N,
int loc)
Name whose locations are all
loc from a String.
This routine parses a non-empty String consisting
of a series of dot-separated components into a Name.
precondition: N.length()>0
public abstract Name prefix(int len)
Name consisting of the first
len identifiers of this. Requires
that len is greater than zero and less than or
equal to the length of this.
public int getEndLoc()
getEndLoc in class ASTNodepublic void check()
check in class ASTNode
|
ESC/Java2 © 2003,2004,2005,2006 David Cok and Joseph Kiniry © 2005,2006 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||