ptolemy.data.expr
Class CachedMethod.BaseConvertCachedMethod

java.lang.Object
  extended byptolemy.data.expr.CachedMethod
      extended byptolemy.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 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
 CachedMethod.ArgumentConversion getBaseConversion()
          Return the conversion that is applied to the object the method is invoked on.
 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getBaseConversion

public CachedMethod.ArgumentConversion getBaseConversion()
Return the conversion that is applied to the object the method is invoked on.


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