| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.llnl.babel.symbols.ASTNode
gov.llnl.babel.symbols.SymbolID
gov.llnl.babel.symbols.Symbol
public abstract class Symbol
The Symbol abstract base class describes the basic
 characteristics shared by all symbols in the symbol table.  All
 SIDL symbols have a symbol identifier, a symbol type, a metadata
 description, and an associated comment.  Four different types of
 symbols are supported: package, enum, class, and interface.
| Field Summary | |
|---|---|
| static int | CLASS | 
| protected  Context | d_context | 
| static int | ENUM | 
| static int | INTERFACE | 
| static int | PACKAGE | 
| static java.lang.String[] | s_type | 
| static java.lang.String | SCOPE | 
| static int | STRUCT | 
| Fields inherited from class gov.llnl.babel.symbols.ASTNode | 
|---|
| d_frozen | 
| Constructor Summary | |
|---|---|
| Symbol(SymbolID id,
       int type,
       Comment comment,
       Context context)Initialize the Symbolabstact base class by providing
 a symbol identifier and its type (one of CLASS, ENUM, INTERFACE, or
 PACKAGE, or STRUCT). | |
| Symbol(SymbolID id,
       int type,
       Comment comment,
       Metadata metadata,
       Context context)Initialize the Symbolabstract base class by providing
 a symbol identifier, a symbol type, a comment, and a metadata object. | |
| Method Summary | |
|---|---|
|  void | addMetadata(java.lang.String keyword,
            java.lang.String value)Add a (keyword,value) pair to the metadata for this symbol. | 
|  void | freeze() | 
| abstract  java.util.Set | getAllSymbolReferences()Return the symbol references for the whole type hierarchy rooted with this symbol. | 
|  java.lang.String | getAttribute(java.lang.String key) | 
|  java.util.Set | getAttributes() | 
| abstract  java.util.Set | getBasicArrayRefs()Return the set of all references to arrays of fundamental types. | 
|  Comment | getComment()Return the comment associated with this symbol. | 
|  int | getDepth()Return how many levels of refinement this type is from a basic type. | 
|  Metadata | getMetadata()Return the metadata associated with this symbol. | 
|  SymbolID | getSymbolID()Return the identifier associated with this symbol. | 
| abstract  java.util.Set | getSymbolReferences()Return the set of symbols (in the form of SymbolID)
 referenced by this particular symbol. | 
|  int | getSymbolType()Return the type of this symbol, one of CLASS, ENUM, INTERFACE, or PACKAGE. | 
|  java.lang.String | getSymbolTypeString()Return the type string associated with this symbol. | 
|  boolean | getUserSpecified()Indicate whether this is a user-specified symbol (or one resulting from dependency resolution) | 
|  boolean | hasAttribute(java.lang.String key) | 
|  boolean | isClass()Return TRUE if the symbol is a class; otherwise, return FALSE. | 
|  boolean | isInterface()Return TRUE if the type of this symbol is an interface; otherwise, return FALSE. | 
|  boolean | isPackage()Return TRUE if the symbol is a package; otherwise, return FALSE. | 
|  boolean | isStruct()Return TRUE if the symbol is a class; otherwise, return FALSE. | 
| static int | minimumDepth(java.util.Collection symbols)Return the minimum depth for a collection of symbols. | 
|  void | removeAttribute(java.lang.String key) | 
|  void | setAttribute(java.lang.String key) | 
|  void | setAttribute(java.lang.String key,
             java.lang.String value) | 
|  void | setComment(Comment comment)Alter the comment. | 
|  void | setUserSpecified(boolean val)Specify whether this symbol was given by the user on the Babel command line | 
| Methods inherited from class gov.llnl.babel.symbols.SymbolID | 
|---|
| compareTo, equals, fromXML, getFullName, getShortName, getShortName, getSymbolName, getVersion, hashCode, setFromXML | 
| Methods inherited from class gov.llnl.babel.symbols.ASTNode | 
|---|
| checkFrozen, clone, protectCollection, protectList, protectMap, protectSet | 
| Methods inherited from class java.lang.Object | 
|---|
| finalize, getClass, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface java.lang.Comparable | 
|---|
| compareTo | 
| Field Detail | 
|---|
public static final int ENUM
public static final int STRUCT
public static final int CLASS
public static final int INTERFACE
public static final int PACKAGE
public static final java.lang.String[] s_type
public static final java.lang.String SCOPE
protected Context d_context
| Constructor Detail | 
|---|
public Symbol(SymbolID id,
              int type,
              Comment comment,
              Context context)
Symbol abstact base class by providing
 a symbol identifier and its type (one of CLASS, ENUM, INTERFACE, or
 PACKAGE, or STRUCT).  The metadata is constructed using the current date and time.
public Symbol(SymbolID id,
              int type,
              Comment comment,
              Metadata metadata,
              Context context)
Symbol abstract base class by providing
 a symbol identifier, a symbol type, a comment, and a metadata object.
| Method Detail | 
|---|
public Comment getComment()
public void setComment(Comment comment)
comment - the new comment.public boolean getUserSpecified()
public int getDepth()
public static int minimumDepth(java.util.Collection symbols)
public void setUserSpecified(boolean val)
public Metadata getMetadata()
getMetadata in interface IMetadata
public void addMetadata(java.lang.String keyword,
                        java.lang.String value)
addMetadata in interface IMetadatapublic SymbolID getSymbolID()
public int getSymbolType()
public boolean isPackage()
public boolean isInterface()
public boolean isClass()
public boolean isStruct()
public java.lang.String getSymbolTypeString()
public abstract java.util.Set getSymbolReferences()
SymbolID)
 referenced by this particular symbol.  The return argument may be
 null if this symbol contains no external references.
public abstract java.util.Set getAllSymbolReferences()
public abstract java.util.Set getBasicArrayRefs()
public boolean hasAttribute(java.lang.String key)
hasAttribute in interface Attributespublic java.lang.String getAttribute(java.lang.String key)
getAttribute in interface Attributespublic void setAttribute(java.lang.String key)
setAttribute in interface Attributes
public void setAttribute(java.lang.String key,
                         java.lang.String value)
setAttribute in interface Attributespublic java.util.Set getAttributes()
getAttributes in interface Attributes
public void removeAttribute(java.lang.String key)
                     throws UnknownAttributeException
removeAttribute in interface AttributesUnknownAttributeExceptionpublic void freeze()
freeze in class ASTNode| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||