|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This type represents a java method in the syntax tree.
| Method Summary | |
void |
addParameter(JFormalParameter param)
Adds an additional formal parameter to this method, appending it to the end of the existing parameter list. |
JBlock |
body()
WMD TODO remove WMD TODO remove |
CMember |
checkInterface(CContextType context)
Checks the basic interfaces to make sure things generally look OK. |
CSourceMethod |
checkInterfaceType(CContextType context,
MemberAccess access,
String ident)
Performs the interface checks that are common to all sorts of methods. |
void |
checkOverriding(CContextType context,
CMethodSet superMethods)
Checks that this method appropriately overrides the given superclass methods. |
int |
compareTo(Object o)
Compares this method to a given method and returns 0 if the methods belong to the same generic function, otherwise returns -1 or +1 to sort the methods. |
CMethodContextType |
createSelfContext(CClassContextType parent)
Creates a context for this method declaration AST node. |
CClassType[] |
getExceptions()
|
boolean |
hasBody()
|
String |
ident()
|
boolean |
isDeclaredNonNull()
|
boolean |
isExternal()
Indicates whether this member is external. |
boolean |
isOverriding()
Return true if this method declaration overrides
any of its superclass (or interfaces) method declarations. |
long |
modifiers()
|
CMethodSet |
overriddenMethods()
Return the set of methods that are directly overriden (specialized) by this method declaration. |
JFormalParameter[] |
parameters()
|
void |
resolveExtMethods(CContextType context)
Makes sure that all in-scope external generic functions are added to the appropriate augmentation maps before top method searches occur in later passes. |
void |
resolveSpecializers(CContextType context)
Computes the values of specializer expressions used to dispatch on compile-time constants. |
void |
resolveTopMethods()
Finds the top method of every declared method. |
CType |
returnType()
|
void |
setModifiers(long modifiers)
Sets the modifiers of this method declaration |
void |
setParameters(JFormalParameter[] parameters)
|
void |
typecheck(CContextType context)
Typechecks this method declaration. |
boolean |
usesMultipleDispatch()
Indicates whether this method uses multiple dispatch |
| Methods inherited from interface org.multijava.mjc.JMemberDeclarationType |
accept, genComments, getCClass, getField, getMethod, isDeprecated |
| Methods inherited from interface org.multijava.util.compiler.PhylumType |
getTokenReference, setTokenReference |
| Methods inherited from interface org.multijava.javadoc.Annotatable |
javadocComment |
| Method Detail |
public JFormalParameter[] parameters()
public void setParameters(JFormalParameter[] parameters)
public void addParameter(JFormalParameter param)
requires param != null;
public String ident()
ident in interface JMemberDeclarationTypepublic CType returnType()
public CClassType[] getExceptions()
public long modifiers()
modifiers in interface JMemberDeclarationTypepublic boolean isDeclaredNonNull()
public void setModifiers(long modifiers)
public JBlock body()
public boolean hasBody()
public boolean usesMultipleDispatch()
public int compareTo(Object o)
throws ClassCastException
compareTo in interface Comparableo - the object to be compared against, must be a
JMethodDeclarationType
ClassCastException - if o is not an instance of
CType public boolean isExternal()
public boolean isOverriding()
true if this method declaration overrides
any of its superclass (or interfaces) method declarations.
public CMethodSet overriddenMethods()
public CMember checkInterface(CContextType context)
throws PositionedError
PositionedError - an error with reference to the
source file
public CSourceMethod checkInterfaceType(CContextType context,
MemberAccess access,
String ident)
throws PositionedError
context - the context in which this method appearsaccess - the MemberAccess object for this methodident - the method name (passed as a parameter
instead of using the field to properly
handle constructors where the field is
the class name but ident is <init>
PositionedError - an error with reference to the
source file
public void resolveSpecializers(CContextType context)
throws PositionedError
context - the context in which this class
declaration appears
PositionedError - if the check fails public void resolveExtMethods(CContextType context)
public void resolveTopMethods()
throws PositionedError
PositionedErrorpublic CMethodContextType createSelfContext(CClassContextType parent)
parent - the parent context
public void typecheck(CContextType context)
throws PositionedError
context - the context in which this method appears
PositionedError - if the checks fail and the failure
cannot be recovered from
public void checkOverriding(CContextType context,
CMethodSet superMethods)
throws PositionedError
context - the context in which this appearssuperMethods - the super type methods that this
may override
PositionedError - if a check fails
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||