randoop
Class RMethod

Object
  extended by RMethod
All Implemented Interfaces:
Serializable, StatementKind

public final class RMethod
extends Object
implements StatementKind, Serializable

Represents a method call. The "R" stands for "Randoop", to underline the distinction from java.lang.reflect.Method.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 int calls_num
           
 long calls_time
           
static String ID
          ID for parsing purposes (see StatementKinds.parse method)
 
Method Summary
Modifier and Type Method and Description
 void appendCode(Variable newVar, List<Variable> inputVars, StringBuilder b)
          Produces a Java source code representation of this statement and append it to the given StringBuilder.
 boolean equals(Object o)
           
 ExecutionOutcome execute(Object[] statementInput, PrintStream out)
          Executes this statement, given the inputs to the statement.
 List<Class<?>> getInputTypes()
          Returns the input types of this method.
 Method getMethod()
          Returns Method object represented by this MethodCallInfo
 Class<?> getOutputType()
          Returns the return type of this method.
static RMethod getRMethod(Method method)
          Returns the statement corresponding to the given constructor.
 int hashCode()
           
 boolean isStatic()
          Returns true if method represented by this MethodCallInfo is a static method.
static StatementKind parse(String s)
           
 String toParseableString()
          A string representing this method.
 String toString()
           
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
ID for parsing purposes (see StatementKinds.parse method)

See Also:
Constant Field Values

calls_time

public long calls_time

calls_num

public int calls_num
Method Detail

getMethod

public Method getMethod()
Returns Method object represented by this MethodCallInfo


getRMethod

public static RMethod getRMethod(Method method)
Returns the statement corresponding to the given constructor.


toString

public String toString()
Overrides:
toString in class Object

appendCode

public void appendCode(Variable newVar,
                       List<Variable> inputVars,
                       StringBuilder b)
Description copied from interface: StatementKind
Produces a Java source code representation of this statement and append it to the given StringBuilder.

Specified by:
appendCode in interface StatementKind

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

execute

public ExecutionOutcome execute(Object[] statementInput,
                                PrintStream out)
Description copied from interface: StatementKind
Executes this statement, given the inputs to the statement. Returns the results of execution as an ResultOrException object and can output results to specified PrintStream.

Specified by:
execute in interface StatementKind
Parameters:
statementInput - array containing appropriate inputs to statement
out - stream to output results of execution; can be null if you don't want to print.
Returns:
results of executing this statement

getInputTypes

public List<Class<?>> getInputTypes()
Returns the input types of this method.

Specified by:
getInputTypes in interface StatementKind

getOutputType

public Class<?> getOutputType()
Returns the return type of this method.

Specified by:
getOutputType in interface StatementKind

isStatic

public boolean isStatic()
Returns true if method represented by this MethodCallInfo is a static method.


toParseableString

public String toParseableString()
A string representing this method. The string is of the form: METHOD Where METHOD is a string representation of the method signature. Examples: java.util.ArrayList.get(int) java.util.ArrayList.add(int,java.lang.Object)

Specified by:
toParseableString in interface StatementKind

parse

public static StatementKind parse(String s)