ptolemy.data.expr
Class CachedMethod.BaseConvertCachedMethod
java.lang.Object
ptolemy.data.expr.CachedMethod
ptolemy.data.expr.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.
Methods inherited from class ptolemy.data.expr.CachedMethod |
_areConversionsPreferable, _getConversion, _polymorphicGetMethod, clear, equals, findMethod, getCachedMethodType, getConversions, getMethod, getReturnType, hashCode, isFunction, isMethod, isValid, methodDescription, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
_baseConversion
private CachedMethod.ArgumentConversion _baseConversion
CachedMethod.BaseConvertCachedMethod
private CachedMethod.BaseConvertCachedMethod(java.lang.String methodName,
Type[] argumentTypes,
java.lang.reflect.Method method,
CachedMethod.ArgumentConversion baseConversion,
CachedMethod.ArgumentConversion[] conversions)
throws IllegalActionException
- Throws:
IllegalActionException
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.