Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

openjava.ptree
Class MethodCall  view MethodCall download MethodCall.java

java.lang.Object
  extended byopenjava.ptree.ParseTreeObject
      extended byopenjava.ptree.NonLeaf
          extended byopenjava.ptree.MethodCall
All Implemented Interfaces:
java.lang.Cloneable, Expression, ParseTree, VariableInitializer

public class MethodCall
extends NonLeaf
implements Expression

The MethodCall class represents a method call expression.


Field Summary
 
Fields inherited from class openjava.ptree.NonLeaf
 
Fields inherited from class openjava.ptree.ParseTreeObject
LN
 
Constructor Summary
(package private) MethodCall()
           
  MethodCall(Expression expr, java.lang.String name, ExpressionList args)
          Allocates a new method call expression object.
  MethodCall(openjava.mop.OJClass clazz, java.lang.String name, ExpressionList args)
           
  MethodCall(java.lang.String name, ExpressionList args)
          Allocates a new method call expression for 'this'.
  MethodCall(TypeName type, java.lang.String name, ExpressionList args)
          Allocates a new method call expression object.
 
Method Summary
 void accept(openjava.ptree.util.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.
 ExpressionList getArguments()
          Gets the arguments for this method.
 java.lang.String getName()
          Gets the method name.
 Expression getReferenceExpr()
          Gets the expression accessed.
 TypeName getReferenceType()
           
 openjava.mop.OJClass getType(openjava.mop.Environment env)
           
private static openjava.mop.OJMethod pickupMethod(openjava.mop.OJClass reftype, java.lang.String name, openjava.mop.OJClass[] argtypes)
           
 void setArguments(ExpressionList exprs)
          Sets the arguments for this method.
 void setName(java.lang.String name)
          Sets the method name.
 void setReferenceExpr(Expression expr)
          Sets the expression accessed.
 void setReferenceType(TypeName type)
           
 
Methods inherited from class openjava.ptree.NonLeaf
childrenAccept, elementAt, equals, getComment, getContents, getLength, makeRecursiveCopy, replaceChildWith, set, set, set, set, set, set, set, set, set, setComment, setElementAt
 
Methods inherited from class openjava.ptree.ParseTreeObject
clone, equal, getObjectID, getParent, hashCode, lastObjectID, makeCopy, replace, setParent, toFlattenString, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface openjava.ptree.ParseTree
childrenAccept, equals, getObjectID, makeCopy, makeRecursiveCopy, replace, toFlattenString, toString
 

Constructor Detail

MethodCall

public MethodCall(Expression expr,
                  java.lang.String name,
                  ExpressionList args)
Allocates a new method call expression object.


MethodCall

public MethodCall(java.lang.String name,
                  ExpressionList args)
Allocates a new method call expression for 'this'. This is equivalent to:
     new MethodCall( (Expression) null, name, args )
 


MethodCall

public MethodCall(TypeName type,
                  java.lang.String name,
                  ExpressionList args)
Allocates a new method call expression object.


MethodCall

public MethodCall(openjava.mop.OJClass clazz,
                  java.lang.String name,
                  ExpressionList args)

MethodCall

MethodCall()
Method Detail

getReferenceExpr

public Expression getReferenceExpr()
Gets the expression accessed.


setReferenceExpr

public void setReferenceExpr(Expression expr)
Sets the expression accessed.


getReferenceType

public TypeName getReferenceType()

setReferenceType

public void setReferenceType(TypeName type)

getName

public java.lang.String getName()
Gets the method name.


setName

public void setName(java.lang.String name)
Sets the method name.


getArguments

public ExpressionList getArguments()
Gets the arguments for this method.


setArguments

public void setArguments(ExpressionList exprs)
Sets the arguments for this method.


accept

public void accept(openjava.ptree.util.ParseTreeVisitor v)
            throws ParseTreeException
Description copied from interface: ParseTree
Accepts a ParseTreeVisitor 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.

Specified by:
accept in interface ParseTree
Specified by:
accept in class ParseTreeObject

getType

public openjava.mop.OJClass getType(openjava.mop.Environment env)
                             throws java.lang.Exception
Specified by:
getType in interface Expression

pickupMethod

private static openjava.mop.OJMethod pickupMethod(openjava.mop.OJClass reftype,
                                                  java.lang.String name,
                                                  openjava.mop.OJClass[] argtypes)