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, isLocalClass
fullName, isLibrary, members, name, parentIsInterfaceDeclaration
modArray
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, visit
equals, getAllFields, getAllMethods, getAllSupertypes, getAllTypes, getConstructors, getDefaultValue, getFields, getFirstElement, getFullName, getLastElement, getMembers, getMethods, getName, getPackage, getProgramElementName, getTypeDeclarationAt, getTypeDeclarationCount, getTypes, isAbstract, isFinal, isLibraryClass, isPrivate, isProtected, isPublic, isStatic
getModifiers, getStateCount, getVisibilityModifier, isGhost, isModel, isNative, isSynchronized
compatibleBlockSize, computeHashCode, equalsModRenaming, getArrayPos, match, matchChildren
getComments, hashCode, prettyPrintMain, reuseSignature
getEndPosition, getFirstElementIncludingBlocks, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComments, match
equalsModRenaming, getEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition
getModifiers
private 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)