public abstract class CallableOperation extends java.lang.Object implements Operation
| Constructor and Description |
|---|
CallableOperation() |
| Modifier and Type | Method and Description |
|---|---|
abstract 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.
|
abstract ExecutionOutcome |
execute(java.lang.Object[] input)
Performs this operation using the array of input values.
|
(package private) java.lang.String |
getArgumentString(Variable variable)
Returns the variable as a string to be used as an argument to an operation.
|
@Nullable java.lang.reflect.AccessibleObject |
getReflectionObject() |
java.lang.Object |
getValue()
Returns the "value" of an operation that is actually a ground term, meaning a constant of some
form.
|
boolean |
isConstantField()
Predicate to indicate whether this object represents a constant field.
|
boolean |
isConstructorCall()
Predicate to indicate whether object represents a call to a constructor.
|
boolean |
isMessage()
Predicate to indicate whether object represents a method-call-like operation (either static or
instance).
|
boolean |
isMethodCall()
Indicates whether this object represents a method-call operation (either static or instance).
|
boolean |
isNonreceivingValue()
Predicate to indicate whether this object represents a value of a non-receiving type (includes
numbers, strings, and null).
|
boolean |
isStatic()
Predicate to indicate whether object represents a static operation on the declaring class.
|
boolean |
isUncheckedCast()
Predicate to indicate whether this object represents an unchecked cast.
|
boolean |
satisfies(ReflectionPredicate reflectionPredicate)
Checks whether reflective object contained in an
Operation satisfies the predicate. |
abstract 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.
|
public boolean isStatic()
Operationpublic boolean isMessage()
Operationpublic boolean isMethodCall()
OperationisMethodCall in interface Operationpublic boolean isConstructorCall()
OperationisConstructorCall in interface Operationpublic boolean isConstantField()
OperationisConstantField in interface Operationpublic boolean isNonreceivingValue()
OperationisNonreceivingValue in interface Operationpublic boolean isUncheckedCast()
OperationisUncheckedCast in interface Operationpublic java.lang.Object getValue()
OperationThis is a hack to allow randoop.main.GenBranchDir to do mutation.
public boolean satisfies(ReflectionPredicate reflectionPredicate)
Operation satisfies the predicate.
Since there is no reflective object in an CallableOperation, returns false.satisfies in interface OperationreflectionPredicate - ReflectionPredicate against which object to be checkedpublic abstract ExecutionOutcome execute(java.lang.Object[] input)
input - array containing appropriate inputs to operationpublic abstract void appendCode(Type declaringType, TypeTuple inputTypes, Type outputType, java.util.List<Variable> inputVars, java.lang.StringBuilder b)
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 - the StringBuilder to which code is addedjava.lang.String getArgumentString(Variable variable)
variable - the variable for which the argument string is constructedpublic abstract java.lang.String toParsableString(Type declaringType, TypeTuple inputTypes, Type outputType)
declaringType - the declaring type for this operationinputTypes - the input types for this operationoutputType - the output type for this operationpublic @Nullable java.lang.reflect.AccessibleObject getReflectionObject()