Class CachedMethod.BaseConvertCachedMethod

  • Enclosing class:
    CachedMethod

    public static class CachedMethod.BaseConvertCachedMethod
    extends CachedMethod
    A cached method that converts the object on which the method is invoked as well as the arguments. This allows us to, for example, invoke instance methods of ptolemy.math.Complex on tokens of type ComplexToken. This cached method can only operate on methods.
    • Method Detail

      • getBaseConversion

        public CachedMethod.ArgumentConversion getBaseConversion()
        Return the conversion that is applied to the object upon which the method is invoked.
        Returns:
        The conversion that is applied to the object upon which the method is invoked.
      • invoke

        public Token invoke​(java.lang.Object[] argValues)
                     throws IllegalActionException
        Description copied from class: CachedMethod
        Apply the operation represented by this object to the specified arguments. This method performs any necessary conversions on token arguments, and, if necessary, converts the returned value into a token. This method may be overridden by derived classes to implement non-standard conversions.
        Overrides:
        invoke in class CachedMethod
        Parameters:
        argValues - An array of Token objects that will be used as the arguments.
        Returns:
        The result of the method invocation, as a Token.
        Throws:
        IllegalActionException - If this cached method is not valid, or the invoked method throws it.