randoop
Class RConstructor

Object
  extended by RConstructor
All Implemented Interfaces:
Serializable, StatementKind

public final class RConstructor
extends Object
implements StatementKind, Serializable

Represents a constructor call. The inputs are parameters to the constructor and outputs include the new object. The "R" stands for "Randoop", to underline the distinction from java.lang.reflect.Constructor.

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 varName, 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.
 Constructor<?> getConstructor()
          Returns the reflection constructor corresponding to this RConstructor.
 List<Class<?>> getInputTypes()
          Returns the input types of this constructor.
 Class<?> getOutputType()
          Returns the return type of this constructor.
static RConstructor getRConstructor(Constructor<?> constructor)
          Creates the RConstructor corresponding to the given reflection constructor.
 int hashCode()
           
static StatementKind parse(String s)
           
 String toParseableString()
          A string representing this constructor.
 String toString()
          Returns concise string representation of this ConstructorCallInfo
 
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

getConstructor

public Constructor<?> getConstructor()
Returns the reflection constructor corresponding to this RConstructor.


getRConstructor

public static RConstructor getRConstructor(Constructor<?> constructor)
Creates the RConstructor corresponding to the given reflection constructor.


toString

public String toString()
Returns concise string representation of this ConstructorCallInfo

Overrides:
toString in class Object

appendCode

public void appendCode(Variable varName,
                       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 constructor.

Specified by:
getInputTypes in interface StatementKind

getOutputType

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

Specified by:
getOutputType in interface StatementKind

toParseableString

public String toParseableString()
A string representing this constructor. The string is of the form: CONSTRUCTOR Where CONSTRUCTOR is a string representation of the constrctor signature. Examples: java.util.ArrayList.() java.util.ArrayList.(java.util.Collection)

Specified by:
toParseableString in interface StatementKind

parse

public static StatementKind parse(String s)