|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 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.ASTDecoration
Provides an extensible way to add 'fields' to the
ASTNode
.
Each ASTDecoration
object essentially corresponds to an
additional field in the ASTNode
class. The value of this
field for a particular ASTNode
object is accessed and
mutated via the instance methods get
and
set
, respectively (see below). Each
ASTDecoration
object also has an associated
String
, which 'names' the corresponding field.
ASTNode
Field Summary | |
private static int |
allocated
* Class variables: * * |
private int |
my_slot
|
private java.lang.String |
name
The name of our decoration |
Constructor Summary | |
ASTDecoration(java.lang.String s)
Creates a new ASTDecoration object with the given
name. |
Method Summary | |
java.lang.Object |
get(ASTNode n)
Return the decoration value of an ASTNode , or null
if the |
void |
set(ASTNode n,
java.lang.Object val)
Set the decoration value of an ASTNode . |
java.lang.String |
toString()
Return the name associated with this . |
java.lang.String |
toString(ASTNode n)
Return a string containing the decoration's name, and the decoration value for this ASTNode . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static int allocated
private int my_slot
private java.lang.String name
Constructor Detail |
public ASTDecoration(java.lang.String s)
ASTDecoration
object with the given
name. The caller should set the decorationType field of the result.
Method Detail |
public java.lang.Object get(ASTNode n)
ASTNode
, or null
if the ASTNode
has no decoration.
public void set(ASTNode n, java.lang.Object val)
ASTNode
.
public java.lang.String toString()
this
.
public java.lang.String toString(ASTNode n)
ASTNode
.
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 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 |