ptolemy.data.expr
Class CachedMethod.ArgumentConversion

java.lang.Object
  extended byptolemy.data.expr.CachedMethod.ArgumentConversion
Direct Known Subclasses:
CachedMethod.TypeArgumentConversion
Enclosing class:
CachedMethod

public static class CachedMethod.ArgumentConversion
extends java.lang.Object

Class representing an argument conversion. Instances of this class are returned by getConversions(). Note that in most cases, it is not necessary to reference this class directly, as the invoke() method applies all the necessary conversions. 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.

The preference is n index given an order to the preference of conversions. Lower preferences represent less desirable conversions than higher preferences.


Field Summary
protected  int _preference
           
 
Method Summary
 java.lang.Object convert(Token input)
          Convert the given token into an object that can be used to invoke a method through the reflection mechanism.
 int getPreference()
          Return the preference of this conversion, relative to other conversions.
 boolean isPreferableTo(CachedMethod.ArgumentConversion conversion)
          Return true if this conversion is preferable to the given conversion.
 java.lang.String toString()
          Return a string representation of this conversion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_preference

protected int _preference
Method Detail

getPreference

public int getPreference()
Return the preference of this conversion, relative to other conversions. The higher the preference, the more preferable the conversion.


convert

public java.lang.Object convert(Token input)
                         throws IllegalActionException
Convert the given token into an object that can be used to invoke a method through the reflection mechanism. Derived classes will override this method to provide different types of argument conversions.

Throws:
IllegalActionException

isPreferableTo

public boolean isPreferableTo(CachedMethod.ArgumentConversion conversion)
Return true if this conversion is preferable to the given conversion.


toString

public java.lang.String toString()
Return a string representation of this conversion.