public class ClassDeclaration extends TypeDeclaration implements Statement
Modifier and Type | Field and Description |
---|---|
protected Extends |
extending |
protected Implements |
implementing |
protected boolean |
isAnonymousClass |
protected boolean |
isInnerClass |
protected boolean |
isLocalClass |
fullName, isLibrary, members, name, parentIsInterfaceDeclaration
modArray
Constructor and Description |
---|
ClassDeclaration(ExtList children,
ProgramElementName fullName,
boolean isLibrary) |
ClassDeclaration(ExtList children,
ProgramElementName fullName,
boolean isLibrary,
boolean innerClass,
boolean anonymousClass,
boolean localClass)
uses children list to create non-anonymous class
|
ClassDeclaration(Modifier[] mods,
ProgramElementName name,
Extends extended,
ProgramElementName fullName,
Implements implemented,
MemberDeclaration[] members,
boolean parentIsInterfaceDeclaration,
boolean isLibrary)
Class declaration.
|
Modifier and Type | Method and Description |
---|---|
ProgramElement |
getChildAt(int index)
Returns the child at the specified index in this node's "virtual"
child array
|
int |
getChildCount()
Returns the number of children of this node.
|
Extends |
getExtendedTypes()
Get extended types.
|
Implements |
getImplementedTypes()
Get implemented types.
|
ImmutableList<KeYJavaType> |
getSupertypes()
returns the local declared supertypes
|
boolean |
isAnonymousClass() |
boolean |
isInnerClass() |
boolean |
isInterface()
Checks if this class type denotes an interface.
|
boolean |
isLocalClass() |
boolean |
isStrictFp()
Classes are never strictfp.
|
boolean |
isTransient()
Classes are never transient.
|
boolean |
isVolatile()
Classes are never volatile.
|
void |
prettyPrint(PrettyPrinter p)
Pretty printing the source element.
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
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
protected final Extends extending
protected final Implements implementing
protected final boolean isInnerClass
protected final boolean isLocalClass
protected final boolean isAnonymousClass
public ClassDeclaration(Modifier[] mods, ProgramElementName name, Extends extended, ProgramElementName fullName, Implements implemented, MemberDeclaration[] members, boolean parentIsInterfaceDeclaration, boolean isLibrary)
mods
- a modifier array.name
- Identifier of the classmembers
- an array containing the memberdeclarations of
this typeimplemented
- of type Implement containing the
interfaces implemented by this classextended
- Extend containing the class extended by
the class of this classdeclarationparentIsInterfaceDeclaration
- boolean true iff
parent is an InterfaceDeclarationpublic ClassDeclaration(ExtList children, ProgramElementName fullName, boolean isLibrary, boolean innerClass, boolean anonymousClass, boolean localClass)
children
- the ExtList with all children building up this
class declaration
May contain: a Extends (as pointer to a
class), a Implements (as pointer to an interface)
ProgramElementName (as name), several MemberDeclaration (as members of
the type), a parentIsInterfaceDeclaration (indicating if parent is
interface), several Modifier (as modifiers of the type decl), a CommentfullName
- the fully qualified ProgramElementName of this classisLibrary
- a boolean flag indicating if this class represents a
library class (such classes have usually no method implementations but
specifications)public ClassDeclaration(ExtList children, ProgramElementName fullName, boolean isLibrary)
public int getChildCount()
getChildCount
in interface NonTerminalProgramElement
public ProgramElement getChildAt(int index)
getChildAt
in interface NonTerminalProgramElement
index
- an index into this node's "virtual" child arrayjava.lang.ArrayIndexOutOfBoundsException
- if index is out
of boundspublic Extends getExtendedTypes()
public Implements getImplementedTypes()
public boolean isStrictFp()
isStrictFp
in interface Member
isStrictFp
in interface MemberDeclaration
isStrictFp
in class TypeDeclaration
true
if this member is strictfp,
false
otherwise.public boolean isTransient()
isTransient
in class JavaDeclaration
public boolean isInnerClass()
public boolean isAnonymousClass()
public boolean isLocalClass()
public boolean isVolatile()
isVolatile
in class JavaDeclaration
public boolean isInterface()
ClassType
isInterface
in interface ClassType
true
if this object represents an interface,
false
if it is an ordinary class.public ImmutableList<KeYJavaType> getSupertypes()
getSupertypes
in interface ClassType
getSupertypes
in class TypeDeclaration
public void visit(Visitor v)
visit
in interface SourceElement
v
- the Visitorpublic void prettyPrint(PrettyPrinter p) throws java.io.IOException
JavaSourceElement
prettyPrint
in interface SourceElement
prettyPrint
in class JavaProgramElement
p
- a pretty printer.java.io.IOException
- occasionally thrown.