class UncheckedCast extends CallableOperation
Operation to perform an explicit cast. NOTE: there is no actual checking of the types
being done. This operation is only used in contexts where the cast is known to be unchecked.| Modifier and Type | Field and Description |
|---|---|
private Type |
type
The result type of the cast.
|
| Constructor and Description |
|---|
UncheckedCast(Type type)
Creates an operation that performs a cast.
|
| 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.
|
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.
|
boolean |
isUncheckedCast()
Predicate to indicate whether this object represents an unchecked cast.
|
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.
|
getArgumentString, getReflectionObject, getValue, isConstantField, isConstructorCall, isMessage, isMethodCall, isNonreceivingValue, isStatic, satisfiesprivate final Type type
UncheckedCast(Type type)
type - the cast typepublic ExecutionOutcome execute(java.lang.Object[] input)
Performs this cast on the first value of the input array.
execute 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)
Appends the code for this cast applied to the given input to the given StringBuilder.
appendCode 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 boolean isUncheckedCast()
OperationisUncheckedCast in interface OperationisUncheckedCast in class CallableOperationpublic 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