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

javafe.ast
Class ASTDecoration

java.lang.Object
  extended byjavafe.ast.ASTDecoration
Direct Known Subclasses:
Utils.BooleanDecoration

public class ASTDecoration
extends java.lang.Object

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.

See Also:
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 ASTNode has no decoration.
 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

allocated

private static int allocated
* Class variables: * *


my_slot

private int my_slot

name

private java.lang.String name
The name of our decoration

Constructor Detail

ASTDecoration

public ASTDecoration(java.lang.String s)
Creates a new ASTDecoration object with the given name.

The caller should set the decorationType field of the result.

Method Detail

get

public java.lang.Object get(ASTNode n)
Return the decoration value of an ASTNode, or null if the ASTNode has no decoration.


set

public void set(ASTNode n,
                java.lang.Object val)
Set the decoration value of an ASTNode.


toString

public java.lang.String toString()
Return the name associated with this.


toString

public java.lang.String toString(ASTNode n)
Return a string containing the decoration's name, and the decoration value for this 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

The ESC/Java2 Project Homepage