public class ArrayCreation extends CallableOperation
ArrayCreation is a Operation 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.| Modifier and Type | Field and 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 and Description |
|---|
ArrayCreation(ArrayType arrayType)
Creates an object representing the construction of an array of the given type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendCode(Type declaringType,
TypeTuple inputTypes,
Type outputType,
java.util.List<Variable> inputVars,
java.lang.StringBuilder b)
Produces a Java source code representation of this statement and appends it to the given
StringBuilder.
|
boolean |
equals(@Nullable java.lang.Object obj) |
ExecutionOutcome |
execute(java.lang.Object[] input)
Performs this operation using the array of input values.
|
java.lang.String |
getName()
Returns the name for the operation.
|
int |
hashCode() |
java.lang.String |
toParsableString(Type declaringType,
TypeTuple inputTypes,
Type outputType)
Returns a string representation of this Operation (not an invocation of this Operation), which
can be read by the static parse method for the class in which the method is defined.
|
java.lang.String |
toString() |
getArgumentString, getReflectionObject, getValue, isConstantField, isConstructorCall, isMessage, isMethodCall, isNonreceivingValue, isStatic, isUncheckedCast, satisfiesprivate final Type elementType
private final Type componentType
private int dimensions
ArrayCreation(ArrayType arrayType)
arrayType - the type of the created arraypublic boolean equals(@Nullable java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic ExecutionOutcome execute(java.lang.Object[] input)
CallableOperationexecute in class CallableOperationinput - array containing appropriate inputs to operationpublic void appendCode(Type declaringType, TypeTuple inputTypes, Type outputType, java.util.List<Variable> inputVars, java.lang.StringBuilder b)
CallableOperationappendCode in class CallableOperationdeclaringType - 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 - the StringBuilder to which code is addedpublic java.lang.String toParsableString(Type declaringType, TypeTuple inputTypes, Type outputType)
CallableOperationtoParsableString in class CallableOperationdeclaringType - the declaring type for this operationinputTypes - the input types for this operationoutputType - the output type for this operationpublic java.lang.String getName()
Operation