|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectast.ASTNode
ast.Member
ast.Method
public class Method
The Method class represents a method declaration within a class declaration. It contains the name of the method (name), a list of formal parameters (formalList), the return type of the method (returnType), and a list of statements from the method body (stmtList).
ASTNode| Field Summary | |
|---|---|
protected FormalList |
formalList
A list of formal parameters |
protected java.lang.String |
name
The name of the method |
protected java.lang.String |
returnType
The return type of the method |
protected StmtList |
stmtList
A list of statements appearing in the method body |
| Fields inherited from class ast.ASTNode |
|---|
charNum, lineNum, lineStr |
| Constructor Summary | |
|---|---|
Method(int lineNum,
java.lang.String returnType,
java.lang.String name,
FormalList formalList,
StmtList stmtList)
Method constructor |
|
| Method Summary | |
|---|---|
java.lang.Object |
accept(Visitor v)
Visitor method |
FormalList |
getFormalList()
Get list of formal parameters |
java.lang.String |
getName()
Get the name of this method |
java.lang.String |
getReturnType()
Get the return type of this method |
StmtList |
getStmtList()
Get list of statements from method body |
| Methods inherited from class ast.ASTNode |
|---|
getLineNum |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String returnType
protected java.lang.String name
protected FormalList formalList
protected StmtList stmtList
| Constructor Detail |
|---|
public Method(int lineNum,
java.lang.String returnType,
java.lang.String name,
FormalList formalList,
StmtList stmtList)
lineNum - source line number corresponding to this AST nodereturnType - the return type of this methodname - the name of this methodformalList - a list of formal parametersstmtList - a list of statements appearing in the method body| Method Detail |
|---|
public java.lang.String getReturnType()
public java.lang.String getName()
public FormalList getFormalList()
public StmtList getStmtList()
public java.lang.Object accept(Visitor v)
accept in class Memberv - visitor object
Visitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||