| 
 | |||||||||
| 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
gov.llnl.babel.symbols.Enumeration
public class Enumeration
The Enumeration class represents a collection of enumerated
 symbols with specified integer values.  Values for enumeration symbols not
 specified by the user are assigned values in an arbitrary fashion.
| Field Summary | 
|---|
| Fields inherited from class gov.llnl.babel.symbols.Symbol | 
|---|
| CLASS, d_context, ENUM, INTERFACE, PACKAGE, s_type, SCOPE, STRUCT | 
| Fields inherited from class gov.llnl.babel.symbols.ASTNode | 
|---|
| d_frozen | 
| Constructor Summary | |
|---|---|
| Enumeration(SymbolID id,
            Comment comment,
            Context context)Create a new Enumerationwith the specified symbol
 identifier and comment. | |
| Enumeration(SymbolID id,
            Comment comment,
            Metadata metadata,
            Context context)Create a new Enumerationwith the specified symbol
 identifier, comment, and metadata. | |
| Method Summary | |
|---|---|
|  void | addEnumerator(java.lang.String name,
              Comment comment)Add a new enumerator without a specified value. | 
|  void | addEnumerator(java.lang.String name,
              int value,
              boolean from_user)Add a new enumerator with a specified value. | 
|  void | addEnumerator(java.lang.String name,
              int value,
              boolean from_user,
              Comment comment)Add a new enumerator with a specified value. | 
|  void | addEnumerator(java.lang.String name,
              int value,
              Comment comment)Add a new enumerator with a specified value. | 
|  boolean | definedByUser(java.lang.String name)Return whether the specified enumerator name was defined by the user (true) or given a value (false). | 
|  void | freeze() | 
|  java.util.Set | getAllSymbolReferences()Return the symbol references for the whole type hierarchy rooted with this symbol. | 
|  java.util.Set | getBasicArrayRefs()Return a null object that represents the external basic arrays references by this enumerated type. | 
|  Comment | getEnumeratorComment(java.lang.String name)Return the comment, if any, for the specified enumerated name. | 
|  java.util.List | getEnumerators()Return the list of enumerators as a sorted list. | 
|  int | getEnumeratorValue(java.lang.String name)Return the value for the specified enumerated name. | 
|  java.util.Iterator | getIterator()Return an Iteratorthat will iterate over the elements
 of the enumeration. | 
|  java.util.Set | getSymbolReferences()Return a null object that represents the external symbols referenced by this enumerated type. | 
|  boolean | hasEnumerator(java.lang.String name)Return whether the current enumeration contains an enumerator with the specified name. | 
| Methods inherited from class gov.llnl.babel.symbols.Symbol | 
|---|
| addMetadata, getAttribute, getAttributes, getComment, getDepth, getMetadata, getSymbolID, getSymbolType, getSymbolTypeString, getUserSpecified, hasAttribute, isClass, isInterface, isPackage, isStruct, minimumDepth, removeAttribute, setAttribute, setAttribute, setComment, setUserSpecified | 
| 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 | 
| Constructor Detail | 
|---|
public Enumeration(SymbolID id,
                   Comment comment,
                   Context context)
Enumeration with the specified symbol
 identifier and comment.
public Enumeration(SymbolID id,
                   Comment comment,
                   Metadata metadata,
                   Context context)
Enumeration with the specified symbol
 identifier, comment, and metadata.
| Method Detail | 
|---|
public void addEnumerator(java.lang.String name,
                          int value,
                          boolean from_user,
                          Comment comment)
public void addEnumerator(java.lang.String name,
                          int value,
                          Comment comment)
public void addEnumerator(java.lang.String name,
                          Comment comment)
public void addEnumerator(java.lang.String name,
                          int value,
                          boolean from_user)
public boolean hasEnumerator(java.lang.String name)
public java.util.List getEnumerators()
public java.util.Iterator getIterator()
Iterator that will iterate over the elements
 of the enumeration.  The iterator will iterate over the names of the
 elements of the enumeration, each of which is a string.
public boolean definedByUser(java.lang.String name)
public int getEnumeratorValue(java.lang.String name)
public Comment getEnumeratorComment(java.lang.String name)
public java.util.Set getSymbolReferences()
getSymbolReferences in class Symbolpublic java.util.Set getAllSymbolReferences()
Symbol
getAllSymbolReferences in class Symbolpublic java.util.Set getBasicArrayRefs()
getBasicArrayRefs in class Symbolpublic void freeze()
freeze in class Symbol| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||