Package randoop.operation
Class ArrayCreation
- java.lang.Object
-
- randoop.operation.CallableOperation
-
- randoop.operation.ArrayCreation
-
- All Implemented Interfaces:
Operation
public class ArrayCreation extends CallableOperation
ArrayCreation
is aOperation
representing the construction of a one-dimensional array of a given type. The operation takes a length argument and creates an array of that size.
-
-
Field Summary
Fields Modifier and Type Field Description private Type
componentType
The component type for the created array.private int
dimensions
The dimensions of the created array.private Type
elementType
The element type for the created array.
-
Constructor Summary
Constructors Constructor Description ArrayCreation(ArrayType arrayType)
Creates an object representing the construction of an array of the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendCode(Type declaringType, TypeTuple inputTypes, Type outputType, List<Variable> inputVars, StringBuilder b)
Produces a Java source code representation of this statement and appends it to the given StringBuilder.boolean
equals(Object obj)
ExecutionOutcome
execute(Object[] input)
Performs this operation using the array of input values.String
getName()
Returns the name for the operation.int
hashCode()
String
toParsableString(Type declaringType, TypeTuple inputTypes, Type outputType)
Returns a string representation of this Operation, which can be read by static parse method for class.String
toString()
-
Methods inherited from class randoop.operation.CallableOperation
getArgumentString, getReflectionObject, getValue, isConstantField, isConstructorCall, isMessage, isMethodCall, isNonreceivingValue, isStatic, isUncheckedCast, satisfies
-
-
-
-
Constructor Detail
-
ArrayCreation
ArrayCreation(ArrayType arrayType)
Creates an object representing the construction of an array of the given type.- Parameters:
arrayType
- the type of the created array
-
-
Method Detail
-
execute
public ExecutionOutcome execute(Object[] input)
Description copied from class:CallableOperation
Performs this operation using the array of input values. Returns the results of execution as an ResultOrException object and can output results to specified PrintStream.- Specified by:
execute
in classCallableOperation
- Parameters:
input
- array containing appropriate inputs to operation- Returns:
- results of executing this statement
-
appendCode
public void appendCode(Type declaringType, TypeTuple inputTypes, Type outputType, List<Variable> inputVars, StringBuilder b)
Description copied from class:CallableOperation
Produces a Java source code representation of this statement and appends it to the given StringBuilder.- Specified by:
appendCode
in classCallableOperation
- Parameters:
declaringType
- the declaring type for this operationinputTypes
- the input types for this operationoutputType
- the output type for this operationinputVars
- the list of variables that are inputs to operationb
- theStringBuilder
to which code is added
-
toParsableString
public String toParsableString(Type declaringType, TypeTuple inputTypes, Type outputType)
Description copied from class:CallableOperation
Returns a string representation of this Operation, which can be read by static parse method for class. For a class C implementing the Operation 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).- Specified by:
toParsableString
in classCallableOperation
- Parameters:
declaringType
- the declaring type for this operationinputTypes
- the input types for this operationoutputType
- the output type for this operation- Returns:
- a string representation of this operation
-
-