|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Node
xtc.type.Type
xtc.type.WrappedT
xtc.type.EnumT
public class EnumT
An enumerated type. Note that the list of members for an enumerated type is the list of enumerators.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class xtc.type.Type |
|---|
Type.Tag |
| Constructor Summary | |
|---|---|
EnumT(java.lang.String name)
Create a new, incomplete enum type. |
|
EnumT(Type type,
java.lang.String name,
java.util.List<EnumeratorT> enumerators)
Create a new enum type. |
|
EnumT(Type template,
Type type,
Nonce nonce,
java.lang.String name,
java.util.List<EnumeratorT> enumerators)
Create a new enum type. |
|
| Method Summary | |
|---|---|
EnumT |
copy()
Create a deep copy of this type. |
boolean |
equals(java.lang.Object o)
Determine whether this type equals the specified object. |
EnumeratorT |
getMember(int index)
Get the member with the specified index. |
int |
getMemberCount()
Get the number of members. |
java.util.List<EnumeratorT> |
getMembers()
Get the members of the tagged type. |
java.lang.String |
getName()
Get the name of this node. |
Nonce |
getNonce()
Get this tagged type's nonce. |
boolean |
hasEnum()
Determine whether this type contains an enum. |
int |
hashCode()
Get this type's hash code. |
boolean |
hasName(java.lang.String name)
Determine whether this node's name is the same as the specified name. |
boolean |
hasTagged()
Determine whether this type is tagged. |
boolean |
isEnum()
Determine whether this type is an enum. |
boolean |
isUnnamed()
Determine whether this tagged type is unnamed. |
Type |
lookup(java.lang.String name)
Look up the member with the specified name. |
Type |
seal()
Seal this enum. |
void |
setMembers(java.util.List<EnumeratorT> enumerators)
Set the list of enumerators. |
void |
setType(Type type)
Set the type. |
EnumT |
toEnum()
Get this type as an enum. |
Tagged |
toTagged()
Get this type as a tagged type. |
void |
write(java.lang.Appendable out)
Write a human readable representation to the specified appendable. |
Type.Tag |
wtag()
Get this wrapped type's tag. |
| Methods inherited from class xtc.type.WrappedT |
|---|
getAttribute, getConstant, getLanguage, getLocation, getScope, getShape, getType, hasAlias, hasAnnotated, hasAttribute, hasConstant, hasEnumerator, hasInstantiated, hasLanguage, hasLocation, hasParameterized, hasScope, hasShape, hasVariable, isWrapped, resolve, tag, toAlias, toAnnotated, toEnumerator, toInstantiated, toParameterized, toStructOrUnion, toVariable, toWrapped |
| Methods inherited from class xtc.tree.Node |
|---|
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getNode, getProperty, getString, getStringProperty, getTokenText, hasProperty, hasTraversal, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, remove, set, size, strip, toAnnotation, toList, toString, toToken |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface xtc.type.Tagged |
|---|
isStruct, isUnion |
| Constructor Detail |
|---|
public EnumT(java.lang.String name)
ErrorT.TYPE as its type.
name - The name.
java.lang.NullPointerException - Signals a null name.
public EnumT(Type type,
java.lang.String name,
java.util.List<EnumeratorT> enumerators)
type - The underlying type.name - The name.enumerators - The enumerators.
java.lang.NullPointerException - Signals a null name.
public EnumT(Type template,
Type type,
Nonce nonce,
java.lang.String name,
java.util.List<EnumeratorT> enumerators)
template - The type whose annotations to copy.type - The underlying type.nonce - The nonce.name - The name.enumerators - The enumerators.
java.lang.NullPointerException - Signals a null name.| Method Detail |
|---|
public EnumT copy()
Type
copy in class Typepublic Type seal()
seal in class WrappedTType.seal(List)public Type.Tag wtag()
Type
wtag in class TypeType.tag()public boolean isEnum()
Type
isEnum in interface TaggedisEnum in class Typetrue if this type is an enum.public boolean hasEnum()
Type
hasEnum in class WrappedTtrue if this type contains an enum.public EnumT toEnum()
Type
toEnum in class WrappedTpublic boolean hasTagged()
Type
hasTagged in class WrappedTtrue if this type is tagged.public Tagged toTagged()
Type
toTagged in class WrappedTType.hasTagged()public void setType(Type type)
sets
the enumerators' types to the specified type, which should be an
integer. When modifying an incomplete type,
this method should be called after the appropriate call to setMembers(List).
setType in class WrappedTtype - The type.
java.lang.IllegalStateException - Signals that this type is sealed.public Nonce getNonce()
Tagged
getNonce in interface Taggedpublic boolean isUnnamed()
Taggedtag(nonce).
isUnnamed in interface Taggedtrue if this tagged type is unnamed.public boolean hasName(java.lang.String name)
Node
hasName in interface TaggedhasName in class Nodename - The name.
true if this node's name equals the
specified name.public java.lang.String getName()
Node
getName in interface TaggedgetName in class Nodepublic Type lookup(java.lang.String name)
Tagged
lookup in interface Taggedname - The name.
ErrorT.TYPE if the tagged type has no
such member.public int getMemberCount()
Tagged
getMemberCount in interface Tagged-1 if this type is
incomplete.public EnumeratorT getMember(int index)
Tagged
getMember in interface Taggedindex - The index.
public java.util.List<EnumeratorT> getMembers()
Tagged
getMembers in interface Taggednull if this type is
incomplete.public void setMembers(java.util.List<EnumeratorT> enumerators)
enumerators. This method
does not change the type of the enumerators.
enumerators - The enumerators.
java.lang.IllegalStateException - Signals that this type is sealed.public int hashCode()
WrappedT
hashCode in class WrappedTpublic boolean equals(java.lang.Object o)
equals in class WrappedTo - The object.
true if this type equals the object.
public void write(java.lang.Appendable out)
throws java.io.IOException
NodeObject.toString().
write in class Nodeout - The appendable.
java.io.IOException - Signals an I/O error.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||