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()
Operation
public boolean isMessage()
Operation
public boolean isMethodCall()
Operation
isMethodCall
in interface Operation
public boolean isConstructorCall()
Operation
isConstructorCall
in interface Operation
public boolean isConstantField()
Operation
isConstantField
in interface Operation
public boolean isNonreceivingValue()
Operation
isNonreceivingValue
in interface Operation
public boolean isUncheckedCast()
Operation
isUncheckedCast
in interface Operation
public java.lang.Object getValue()
Operation
This 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 Operation
reflectionPredicate
- 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()