aspoev.interpreter.base
Class MethodDeclarationElement
java.lang.Object
aspoev.interpreter.base.Element
aspoev.interpreter.base.MethodDeclarationElement
- All Implemented Interfaces:
- java.lang.Cloneable, aspoev.Executable, MemberElement, pJ.jasmine.PRI, java.io.Serializable
- Direct Known Subclasses:
- ConstructorDeclarationElement
- public class MethodDeclarationElement
- extends Element
- implements MemberElement, pJ.jasmine.PRI
A meta method. This structure contains the executable portion of
vejal types.
- See Also:
- Serialized Form
| Fields inherited from class aspoev.interpreter.base.Element |
parent |
| Fields inherited from interface pJ.jasmine.PRI |
DELETECHANGE, MODIFYCHANGE, NOCHANGE |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ID_BASE
protected static int ID_BASE
uniqueID
protected int uniqueID
methodBody
protected BlockElement methodBody
methodParameters
protected ParameterListElement methodParameters
methodName
protected java.lang.String methodName
returnType
protected TypeReferenceElement returnType
MethodDeclarationElement
public MethodDeclarationElement()
MethodDeclarationElement
public MethodDeclarationElement(TypeReferenceElement returnType,
java.lang.String methodName,
ParameterListElement parameters,
BlockElement methodBody)
addParameter
public void addParameter(TypeReferenceElement paramType,
java.lang.String paramName,
int position)
addParameter
protected void addParameter(TypeReferenceElement newParam,
java.lang.String paramName)
changeMethodName
protected java.lang.String changeMethodName(java.lang.String newName)
changeParameterType
protected TypeReferenceElement changeParameterType(int position,
TypeReferenceElement newType)
changeReturnType
public TypeReferenceElement changeReturnType(TypeReferenceElement newType)
clone
public java.lang.Object clone()
- Returns a copy of this method.
- Specified by:
clone in class Element
equals
public boolean equals(java.lang.Object other)
execute
public java.lang.Object execute(ArgumentListElement arguments)
executeElement
protected java.lang.Object executeElement()
- Specified by:
executeElement in class Element
getTypeDependencies
public java.util.Collection getTypeDependencies()
getDeclaration
public TypeReferenceElement getDeclaration()
- Returns the type in which this method is declared.
getDeclaration
public VariableDeclarationElement getDeclaration(VariableReferenceElement handle)
- Returns the local declaration of the variable. If the variable
was not declared locally, returns null.
getFieldReferences
public java.util.Collection getFieldReferences()
getVariableDeclarations
public java.util.Collection getVariableDeclarations()
getVariableReferences
public java.util.Collection getVariableReferences()
getMethodInvokations
public java.util.Collection getMethodInvokations()
getMethodInvokations
public java.util.Collection getMethodInvokations(MethodDeclarationElement method)
getNumParameters
public int getNumParameters()
getRValue
public java.lang.Object getRValue()
- Overrides:
getRValue in class Element
getStaticType
public TypeReferenceElement getStaticType(VariableReferenceElement variable)
getParameters
public ParameterListElement getParameters()
getParameterTypes
public TypeReferenceElement[] getParameterTypes()
getSigniture
public java.lang.String getSigniture()
invokesMethod
public boolean invokesMethod(MethodDeclarationElement method)
referencesField
public boolean referencesField(FieldDeclarationElement field)
usesMember
public boolean usesMember(MemberElement member)
setDeclaration
public void setDeclaration(ClassDeclarationElement declaration)
setBody
public void setBody(BlockElement body)
setParameters
public void setParameters(ParameterListElement params)
signitureMatch
public int signitureMatch(MethodDeclarationElement otherMethod)
- Returns an integer describing how equal the signiture of the
other method is to the signiture of this method. 0 is a perfect
match.
parameterTypeMatch
public int parameterTypeMatch(TypeReferenceElement[] paramTypes)
getChildrenByType
public java.util.Collection getChildrenByType(java.lang.Class childClass)
- Specified by:
getChildrenByType in class Element
getCodeString
public java.lang.String getCodeString()
- Specified by:
getCodeString in class Element
toShortString
public java.lang.String toShortString()