ptolemy.data.expr
Class CachedMethod.MatrixMapCachedMethod

java.lang.Object
  extended by ptolemy.data.expr.CachedMethod
      extended by ptolemy.data.expr.CachedMethod.MatrixMapCachedMethod
Enclosing class:
CachedMethod

public static class CachedMethod.MatrixMapCachedMethod
extends CachedMethod

A class representing the invocation of a scalar method on a matrix of elements.


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
private  CachedMethod _cachedMethod
           
private  boolean[] _reducedArgs
           
 
Fields inherited from class ptolemy.data.expr.CachedMethod
ARRAYTOKEN_CONVERSION, FUNCTION, IDENTITY_CONVERSION, IMPOSSIBLE_CONVERSION, METHOD, NATIVE_CONVERSION
 
Constructor Summary
CachedMethod.MatrixMapCachedMethod(java.lang.String methodName, Type[] argumentTypes, int type, CachedMethod cachedMethod, boolean[] reducedArgs)
          Constructs a CachedMethod$MatrixMapCachedMethod object.
 
Method Summary
 Type getReturnType()
          Return the type of the token that results from an invocation of this method.
 Token invoke(java.lang.Object[] argValues)
          Run method represented by this cachedMethod.
 boolean isValid()
          Override the base class to correctly implement the isValid() method.
 java.lang.String methodDescription()
          Return an appropriate description of the method being invoked.
 
Methods inherited from class ptolemy.data.expr.CachedMethod
_areConversionsPreferable, _getConversion, _polymorphicGetMethod, clear, equals, findMethod, getCachedMethodType, getConversions, getMethod, hashCode, isFunction, isMethod, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_cachedMethod

private CachedMethod _cachedMethod

_reducedArgs

private boolean[] _reducedArgs
Constructor Detail

CachedMethod.MatrixMapCachedMethod

public CachedMethod.MatrixMapCachedMethod(java.lang.String methodName,
                                          Type[] argumentTypes,
                                          int type,
                                          CachedMethod cachedMethod,
                                          boolean[] reducedArgs)
                                   throws IllegalActionException
Constructs a CachedMethod$MatrixMapCachedMethod object.

Parameters:
methodName - The name of the method.
argumentTypes - The types of the arguments.
type - An integer specifying the type
cachedMethod - The method to be invoked
reducedArgs - An array of booleans where if an element of the array is true and the corresponding argument is an MatrixToken, then invoke() handles those arguments specially.
Throws:
IllegalActionException - Not thrown in this derived class, but the superclass throws it if the return type of the cached method cannot be determined.
Method Detail

invoke

public Token invoke(java.lang.Object[] argValues)
             throws IllegalActionException
Run method represented by this cachedMethod. This includes any conversions necessary to turn token arguments into other arguments, and to convert the result back into a token.

Overrides:
invoke in class CachedMethod
Parameters:
argValues - An array of token objects that will be used as the arguments.
Returns:
The token result of the method invocation.
Throws:
IllegalActionException - If the invoked method throws it.

isValid

public boolean isValid()
Override the base class to correctly implement the isValid() method.

Overrides:
isValid in class CachedMethod
Returns:
True if a method was found.

getReturnType

public Type getReturnType()
                   throws IllegalActionException
Description copied from class: CachedMethod
Return the type of the token that results from an invocation of this method. Note that in most cases, it is not necessary to call this method, as the invoke() method provides all the necessary information. It is provided for code, such as the code generator that need more than the usual amount of information about methods that have been found.

Overrides:
getReturnType in class CachedMethod
Returns:
The type of the token that results from an invocation of this method.
Throws:
IllegalActionException - If a method or function with the correct argument types was not found.

methodDescription

public java.lang.String methodDescription()
Return an appropriate description of the method being invoked.

Overrides:
methodDescription in class CachedMethod
Returns:
A description of the method being invoked.