Class TypedClassOperationWithCast

All Implemented Interfaces:
Comparable<TypedOperation>, Operation

public class TypedClassOperationWithCast extends TypedClassOperation
Represents a method with a return type that is a type variable that must be instantiated, and for which execution performs a cast to the instantiating type to emulate handling of casts that are not done in reflection.
  • Constructor Details

  • Method Details

    • substitute

      public TypedClassOperationWithCast substitute(Substitution substitution)
      Description copied from class: TypedClassOperation
      Applies the given substitution to the generic types in this operation, and returns a new operation with the instantiated types.

      Applies the substitution to the declaring type, all input types, and the output type.

      Overrides:
      substitute in class TypedClassOperation
      Parameters:
      substitution - the substitution
      Returns:
      the operation resulting from applying the substitution to the types of this operation
    • applyCaptureConversion

      public TypedClassOperationWithCast applyCaptureConversion()
      Description copied from class: TypedOperation
      Applies a capture conversion to the wildcard types of this operation, and returns a new operation with new type variables for the wildcard types.
      Overrides:
      applyCaptureConversion in class TypedClassOperation
      Returns:
      the operation result from applying a capture conversion to wildcard types of this operation
    • execute

      public ExecutionOutcome execute(Object[] input)
      Performs this operation using the array of input values. Returns the results of execution as an ResultOrException object and can output results to specified PrintStream.

      Performs cast to output type of this operation to ensure that any ClassCastException that would be thrown in JVM execution is also thrown.

      Overrides:
      execute in class TypedOperation
      Parameters:
      input - array containing appropriate inputs to operation
      Returns:
      results of executing this statement