gov.llnl.babel.symbols
public class Enumeration extends Symbol
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.Constructor and Description |
---|
Enumeration(SymbolID id,
Comment comment,
Context context)
Create a new
Enumeration with the specified symbol
identifier and comment. |
Enumeration(SymbolID id,
Comment comment,
Metadata metadata,
Context context)
Create a new
Enumeration with the specified symbol
identifier, comment, and metadata. |
Modifier and Type | Method and Description |
---|---|
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
Iterator that 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.
|
addMetadata, getAttribute, getAttributes, getComment, getDepth, getMetadata, getSymbolID, getSymbolType, getSymbolTypeString, getUserSpecified, hasAttribute, isClass, isInterface, isPackage, isStruct, minimumDepth, removeAttribute, setAttribute, setAttribute, setComment, setUserSpecified
compareTo, equals, fromXML, getFullName, getShortName, getShortName, getSymbolName, getVersion, hashCode, isSymbolBindC, setFromXML
checkFrozen, clone, protectCollection, protectList, protectMap, protectSet
public Enumeration(SymbolID id, Comment comment, Context context)
Enumeration
with the specified symbol
identifier and comment.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 Symbol
public java.util.Set getAllSymbolReferences()
Symbol
getAllSymbolReferences
in class Symbol
public java.util.Set getBasicArrayRefs()
getBasicArrayRefs
in class Symbol