|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--openjava.ptree.ParseTreeObject
|
+--openjava.ptree.NonLeaf
|
+--openjava.ptree.MethodCall
The MethodCall class represents
a method call expression.
NonLeaf,
Expression| Field Summary |
| Fields inherited from class openjava.ptree.NonLeaf |
|
| Fields inherited from class openjava.ptree.ParseTreeObject |
debugFlag, debugLevel, LN, out, writerStack |
| Constructor Summary | |
(package private) |
MethodCall()
|
|
MethodCall(Expression expr,
String name,
ExpressionList args)
Allocates a new method call expression object. |
|
MethodCall(OJClass clazz,
String name,
ExpressionList args)
|
|
MethodCall(String name,
ExpressionList args)
Allocates a new method call expression for 'this'. |
|
MethodCall(TypeName type,
String name,
ExpressionList args)
Allocates a new method call expression object. |
| Method Summary | |
void |
accept(ParseTreeVisitor v)
Accepts a ParseTreeVisitor object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern. |
boolean |
equals(ParseTree p)
Tests if this parse-tree-node's value equals to the specified ptree-node's. |
ExpressionList |
getArguments()
Gets the arguments for this method. |
String |
getName()
Gets the method name. |
Expression |
getReferenceExpr()
Gets the expression accessed. |
TypeName |
getReferenceType()
|
OJClass |
getType(Environment env)
|
private static OJMethod |
pickupMethod(OJClass reftype,
String name,
OJClass[] argtypes)
|
OJMethod |
resolve(Environment env)
Returns the method that this call is to. |
void |
setArguments(ExpressionList exprs)
Sets the arguments for this method. |
void |
setName(String name)
Sets the method name. |
void |
setReferenceExpr(Expression expr)
Sets the expression accessed. |
void |
setReferenceType(TypeName type)
|
void |
writeCode()
Writes the code this parse-tree presents for. |
| Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept, childrenAreEqual, elementAt, getComment, getContents, getLength, getRowType, makeRecursiveCopy, replaceChildWith, set, set, set, set, set, set, set, set, set, setComment, setElementAt |
| Methods inherited from class openjava.ptree.ParseTreeObject |
clone, eq, eq, equal, flushPrintWriter, getDebugFlag, getNest, getObjectID, getParent, getPrintWriter, getTab, hashCode, lastObjectID, makeCopy, popNest, popPrintWriter, pushNest, pushPrintWriter, replace, setDebugFlag, setDebugLevel, setNest, setParent, setPrintStream, setTab, toFlattenString, toString, writeDebug, writeDebugL, writeDebugLln, writeDebugln, writeDebugLR, writeDebugR, writeDebugRln, writeTab |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface openjava.ptree.Expression |
getRowType |
| Methods inherited from interface openjava.ptree.ParseTree |
childrenAccept, eq, getObjectID, makeCopy, makeRecursiveCopy, replace, toFlattenString, toString |
| Constructor Detail |
public MethodCall(Expression expr,
String name,
ExpressionList args)
expr - the expression which indicates an object or
a class. This may be null for invocation on 'this'.name - the method name.args - the argumetns for this method.
public MethodCall(String name,
ExpressionList args)
new MethodCall( (Expression) null, name, args )
name - the method name.args - the argumetns for this method.
public MethodCall(TypeName type,
String name,
ExpressionList args)
name - the method name.args - the argumetns for this method.
public MethodCall(OJClass clazz,
String name,
ExpressionList args)
MethodCall()
| Method Detail |
public void writeCode()
NonLeaf
writeCode in interface ParseTreewriteCode in class NonLeafpublic Expression getReferenceExpr()
public void setReferenceExpr(Expression expr)
expr - the expression accessed.public TypeName getReferenceType()
public void setReferenceType(TypeName type)
public String getName()
public void setName(String name)
name - the method name.public ExpressionList getArguments()
public void setArguments(ExpressionList exprs)
exprs - the expression list as the arguments.
public void accept(ParseTreeVisitor v)
throws ParseTreeException
ParseTreeParseTreeVisitor object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern.
This invoke an appropriate visit() method on the
accepted visitor.
accept in interface ParseTreeaccept in class ParseTreeObjectv - a visitor
ParseTreeException
public OJClass getType(Environment env)
throws Exception
getType in interface ExpressionException
public OJMethod resolve(Environment env)
throws Exception
Exception
private static OJMethod pickupMethod(OJClass reftype,
String name,
OJClass[] argtypes)
public boolean equals(ParseTree p)
ParseTree
equals in interface ParseTreeequals in class NonLeaf
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||