randoop
Interface StatementKind

All Known Implementing Classes:
ArrayDeclaration, DummyStatement, PrimitiveOrStringOrNullDecl, RConstructor, RMethod

public interface StatementKind

Represents a kind of statement that can be part of a sequence, for example, a method call, constructor call, or primitive value declaration.

An implementing class C should additionally provide the following:


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.
 ExecutionOutcome execute(Object[] statementInput, PrintStream out)
          Executes this statement, given the inputs to the statement.
 List<Class<?>> getInputTypes()
          Returns the (ordered) list of input types for this statement kind.
 Class<?> getOutputType()
          Returns the type of this statement kind's output.
 String toParseableString()
          Returns a string representation of this StatementKind, which can subsequently be used in this class's parse method.
 

Method Detail

getInputTypes

List<Class<?>> getInputTypes()
Returns the (ordered) list of input types for this statement kind.


getOutputType

Class<?> getOutputType()
Returns the type of this statement kind's output.


execute

ExecutionOutcome execute(Object[] statementInput,
                         PrintStream out)
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.

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

appendCode

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.


toParseableString

String toParseableString()
Returns a string representation of this StatementKind, which can subsequently be used in this class's parse method. For a class C implementing the StatementKind interface, this method should return a String s such that parsing the string returns an object equivalent to this object, i.e. C.parse(this.s).equals(this).