public class TypedClassOperation extends TypedOperation
TypedOperation.RankedTypeOperation| Modifier and Type | Field and Description |
|---|---|
private ClassOrInterfaceType |
declaringType
The declaring type for this operation.
|
private @MonotonicNonNull RawSignature |
rawSignature
The cached value of
getRawSignature(). |
compareRankedTypeOperation, inputTypes| Constructor and Description |
|---|
TypedClassOperation(CallableOperation operation,
ClassOrInterfaceType declaringType,
TypeTuple inputTypes,
Type outputType)
Creates a
TypedClassOperation for a given CallableOperation indicating the
signature of the operation. |
TypedClassOperation(CallableOperation operation,
ClassOrInterfaceType declaringType,
TypeTuple inputTypes,
Type outputType,
ExecutableSpecification execSpec)
Creates a
TypedClassOperation for a given CallableOperation indicating the
signature of the operation. |
| Modifier and Type | Method and Description |
|---|---|
void |
appendCode(java.util.List<Variable> inputVars,
java.lang.StringBuilder b)
Produces a Java source code representation of this operation and appends it to the given
StringBuilder.
|
TypedClassOperation |
applyCaptureConversion()
Applies a capture conversion to the wildcard types of this operation, and returns a new
operation with new type variables for the wildcard types.
|
boolean |
equals(@Nullable java.lang.Object obj) |
ClassOrInterfaceType |
getDeclaringType()
Returns the class in which the operation is defined.
|
@Nullable java.lang.String |
getFullyQualifiedSignature()
Returns the fully-qualified signature for this operation if it is a method or constructor call.
|
java.lang.String |
getName()
Returns the name for the operation.
|
TypedClassOperation |
getOperationForType(ClassOrInterfaceType type)
Creates an operation with the same name, input types, and output type as this operation, but
having the given type as the owning class.
|
@Nullable RawSignature |
getRawSignature()
Returns the
RawSignature for this operation if it is a method or constructor call. |
java.util.List<TypeVariable> |
getTypeParameters()
Returns an empty list representing the type parameters of this.
|
java.lang.String |
getUnqualifiedBinaryName()
Returns the simple name of this operation, not qualified by the declaring class.
|
int |
hashCode() |
boolean |
hasWildcardTypes()
Indicates whether this operation has a type that is a wildcard type.
|
TypedClassOperation |
substitute(Substitution substitution)
Applies the given substitution to the generic types in this operation, and returns a new
operation with the instantiated types.
|
java.lang.String |
toParsableString()
Returns a string representation of this Operation, which can be read by the static
parse method for an Operation class. |
java.lang.String |
toString() |
checkPrestate, compareTo, createArrayCreation, createArrayElementAssignment, createCast, createGetterForField, createInitializedArrayCreation, createNonreceiverInitialization, createNullOrZeroInitializationForType, createPrimitiveInitialization, createSetterForField, execute, forConstructor, forMethod, getExecutableSpecification, getInputTypes, getOperation, getOutputType, getSignatureString, getValue, isConstantField, isConstructorCall, isGeneric, isGeneric, isMessage, isMethodCall, isNonreceivingValue, isStatic, isUncheckedCast, satisfies, setExecutableSpecificationprivate final ClassOrInterfaceType declaringType
private @MonotonicNonNull RawSignature rawSignature
getRawSignature().public TypedClassOperation(CallableOperation operation, ClassOrInterfaceType declaringType, TypeTuple inputTypes, Type outputType)
TypedClassOperation for a given CallableOperation indicating the
signature of the operation.operation - the CallableOperationdeclaringType - the declaring class type for this operationinputTypes - the input types for the operationoutputType - the output types for the operationpublic TypedClassOperation(CallableOperation operation, ClassOrInterfaceType declaringType, TypeTuple inputTypes, Type outputType, ExecutableSpecification execSpec)
TypedClassOperation for a given CallableOperation indicating the
signature of the operation.operation - the CallableOperationdeclaringType - the declaring class type for this operationinputTypes - the input types for the operationoutputType - the output types for the operationexecSpec - the specification for the operationpublic boolean equals(@Nullable java.lang.Object obj)
equals in class TypedOperationpublic int hashCode()
hashCode in class TypedOperationpublic ClassOrInterfaceType getDeclaringType()
public TypedClassOperation substitute(Substitution substitution)
Applies the substitution to the declaring type, all input types, and the output type.
substitute in class TypedOperationsubstitution - the substitutionpublic TypedClassOperation applyCaptureConversion()
TypedOperationapplyCaptureConversion in class TypedOperationpublic void appendCode(java.util.List<Variable> inputVars, java.lang.StringBuilder b)
appendCode in class TypedOperationinputVars - the list of variables that are inputs to operationb - the StringBuilder to which code is addedpublic java.lang.String toParsableString()
parse method for an Operation 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).toParsableString in class TypedOperationOperation objectpublic java.lang.String toString()
toString in class TypedOperationpublic java.lang.String getName()
OperationgetName in interface OperationgetName in class TypedOperationpublic java.lang.String getUnqualifiedBinaryName()
public boolean hasWildcardTypes()
TypedOperationhasWildcardTypes in class TypedOperationpublic java.util.List<TypeVariable> getTypeParameters()
TypedOperationgetTypeParameters in class TypedOperationpublic @Nullable java.lang.String getFullyQualifiedSignature()
public @Nullable RawSignature getRawSignature()
RawSignature for this operation if it is a method or constructor call.RawSignature of this method or constructor operation, null if this is
another kind of operationpublic TypedClassOperation getOperationForType(ClassOrInterfaceType type)
Note: this is only a valid object if type has the method. This is definitely the
case if type is a subtype of the declaring type of the operation, but this method does
not force that check because we sometimes want to create the operation for superclasses.
type - a type to substitute into the operationtype substituted for the declaring type of this operation.
The returned object will be invalid if type does not have the method. The returned
object may be this, if the argument is already this's declaring type.