com.sun.slamd.scripting.engine
Class Method

java.lang.Object
  extended bycom.sun.slamd.scripting.engine.Method

public class Method
extends java.lang.Object

This class simply holds information about a method signature, including the name of the method, the types of arguments that it accepts, and the return type for the method. Note that all matching in this method is case sensitive, so it is expected that all strings will be converted to lowercase before they are provided to anything in this class.


Constructor Summary
Method(java.lang.String name, java.lang.String[] argumentTypes, java.lang.String returnType)
          Creates a new method with the specified name, argument types, and return type.
 
Method Summary
 java.lang.String[] getArgumentTypes()
          Retrieves the set of argument types for this method.
 java.lang.String getName()
          Retrieves the name of this method.
 java.lang.String getReturnType()
          Retrieves the return type of this method.
 boolean hasSignature(java.lang.String name, java.lang.String[] argumentTypes)
          Indicates whether this method has the specified name and set of argument types.
 boolean hasSignature(java.lang.String name, java.lang.String[] argumentTypes, java.lang.String returnType)
          Indicates whether this method has the specified name, set of argument types, and return type.
 boolean isNamed(java.lang.String name)
          Indicates whether the name of this method matches the specified name.
 java.lang.String toString()
          Retrieves a string representation of this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Method

public Method(java.lang.String name,
              java.lang.String[] argumentTypes,
              java.lang.String returnType)
Creates a new method with the specified name, argument types, and return type.

Parameters:
name - The name of the method.
argumentTypes - The names of the data types of all the arguments for this method.
returnType - The name of the data type that this method returns.
Method Detail

getName

public java.lang.String getName()
Retrieves the name of this method.

Returns:
The name of this method.

getArgumentTypes

public java.lang.String[] getArgumentTypes()
Retrieves the set of argument types for this method.

Returns:
The name set of argument types for this method.

getReturnType

public java.lang.String getReturnType()
Retrieves the return type of this method.

Returns:
The return type of this method.

isNamed

public boolean isNamed(java.lang.String name)
Indicates whether the name of this method matches the specified name.

Parameters:
name - The name to compare against this method.
Returns:
true if the name of this method matches the specified name, or false if not.

hasSignature

public boolean hasSignature(java.lang.String name,
                            java.lang.String[] argumentTypes)
Indicates whether this method has the specified name and set of argument types.

Parameters:
name - The name to compare against that of this method.
argumentTypes - The set of argument types to compare against those of this method.
Returns:
true if this method does have the specified name and set of argument types, or false if it does not.

hasSignature

public boolean hasSignature(java.lang.String name,
                            java.lang.String[] argumentTypes,
                            java.lang.String returnType)
Indicates whether this method has the specified name, set of argument types, and return type.

Parameters:
name - The name to compare against that of this method.
argumentTypes - The set of argument types to compare against those of this method.
returnType - The name of the return type to compare against that of this method.
Returns:
true if this method does have the specified name, set of argument types, and return type, or false if it does not.

toString

public java.lang.String toString()
Retrieves a string representation of this method.

Returns:
A string representation of this method.