Package 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.data.expr.CachedMethod
CachedMethod.ArgumentConversion, CachedMethod.ArrayMapCachedMethod, CachedMethod.BaseConvertCachedMethod, CachedMethod.MatrixMapCachedMethod, CachedMethod.TypeArgumentConversion
-
-
Field Summary
-
Fields inherited from class ptolemy.data.expr.CachedMethod
ARRAYTOKEN_CONVERSION, FUNCTION, IDENTITY_CONVERSION, IMPOSSIBLE_CONVERSION, METHOD, NATIVE_CONVERSION
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CachedMethod.ArgumentConversion
getBaseConversion()
Return the conversion that is applied to the object upon which the method is invoked.Token
invoke(java.lang.Object[] argValues)
Apply the operation represented by this object to the specified arguments.-
Methods inherited from class ptolemy.data.expr.CachedMethod
_areConversionsPreferable, _getConversion, _polymorphicGetMethod, clear, equals, findMethod, getCachedMethodType, getConversions, getMethod, getReturnType, hashCode, isFunction, isMethod, isValid, methodDescription, toString
-
-
-
-
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 classCachedMethod
- 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.
-
-