public class EnumClassDeclaration extends ClassDeclaration
In addition the programvariables that represent enum constants are memorized. Thus this class is able to have queries on the enum constants.
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<IProgramVariable> |
constants
store the program variables which represent the enum constants
|
extending, implementing, isAnonymousClass, isInnerClass, isLocalClassfullName, isLibrary, members, name, parentIsInterfaceDeclarationmodArray| Constructor and Description |
|---|
EnumClassDeclaration(ExtList children,
ProgramElementName fullName,
boolean isLibrary,
java.util.List<EnumConstantDeclaration> enumConstantDeclarations)
create a new EnumClassDeclaration that describes an enum defintion.
|
| Modifier and Type | Method and Description |
|---|---|
private IProgramVariable |
findAttr(java.lang.String fieldName) |
int |
getNumberOfConstants()
get the number of defined enum constants in this type.
|
static int |
indexOf(ProgramVariable attribute) |
static boolean |
isEnumConstant(IProgramVariable attribute)
check whether a PV is an enum constant of any enum type.
|
private boolean |
isLocalEnumConstant(IProgramVariable pv) |
private int |
localIndexOf(ProgramVariable pv)
get the index of the program variable amongst the enumconstants of THIS enum.
|
getChildAt, getChildCount, getExtendedTypes, getImplementedTypes, getSupertypes, isAnonymousClass, isInnerClass, isInterface, isLocalClass, isStrictFp, isTransient, isVolatile, prettyPrint, visitequals, getAllFields, getAllMethods, getAllSupertypes, getAllTypes, getConstructors, getDefaultValue, getFields, getFirstElement, getFullName, getLastElement, getMembers, getMethods, getName, getPackage, getProgramElementName, getTypeDeclarationAt, getTypeDeclarationCount, getTypes, isAbstract, isFinal, isLibraryClass, isPrivate, isProtected, isPublic, isStaticgetModifiers, getStateCount, getVisibilityModifier, isGhost, isModel, isNative, isSynchronizedcompatibleBlockSize, computeHashCode, equalsModRenaming, getArrayPos, match, matchChildrengetComments, hashCode, prettyPrintMain, reuseSignaturegetEndPosition, getFirstElementIncludingBlocks, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetComments, matchequalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPositiongetModifiersprivate java.util.List<IProgramVariable> constants
public EnumClassDeclaration(ExtList children, ProgramElementName fullName, boolean isLibrary, java.util.List<EnumConstantDeclaration> enumConstantDeclarations)
children - children in the ast (members)fullName - of the class/enumisLibrary - see class constructorenumConstantDeclarations - the declarations for the enum constantsprivate IProgramVariable findAttr(java.lang.String fieldName)
private boolean isLocalEnumConstant(IProgramVariable pv)
private int localIndexOf(ProgramVariable pv)
pv - PV to look uppublic int getNumberOfConstants()
public static boolean isEnumConstant(IProgramVariable attribute)
attribute - ProgramVariable to check.public static int indexOf(ProgramVariable attribute)