com.metamatrix.query.function.metadata
Class FunctionMethod

java.lang.Object
  extended by com.metamatrix.query.function.metadata.FunctionMethod
All Implemented Interfaces:
java.io.Serializable

public class FunctionMethod
extends java.lang.Object
implements java.io.Serializable

This class represents information about a particular function signature. Function signatures are unique with respect to their name, # of arguments, and type of arguments. Return type and argument names are not uniqueness factors. This class makes no attempt to validate the data put into it, particularly with respect to null values. The FunctionMetadataValidator can be used to validate this object.

Attributes:

See Also:
FunctionParameter, FunctionMetadataValidator, FunctionCategoryConstants, Serialized Form

Field Summary
static int CAN_PUSHDOWN
           
static int CANNOT_PUSHDOWN
           
static int COMMAND_DETERMINISTIC
           
static int DETERMINISTIC
           
static int MUST_PUSHDOWN
           
static int NONDETERMINISTIC
           
static int SERVER_DETERMINISTIC
           
static int SESSION_DETERMINISTIC
           
static int SYNTHETIC
           
 
Constructor Summary
FunctionMethod()
          Construct a new empty function method.
FunctionMethod(java.lang.String name, java.lang.String description, java.lang.String category, int pushdown, java.lang.String invocationClass, java.lang.String invocationMethod, FunctionParameter[] inputParams, FunctionParameter outputParam)
          Construct a function method with all parameters assuming null dependent and non-deterministic.
FunctionMethod(java.lang.String name, java.lang.String description, java.lang.String category, int pushdown, java.lang.String invocationClass, java.lang.String invocationMethod, FunctionParameter[] inputParams, FunctionParameter outputParam, boolean nullDependent, int deterministic)
          Construct a function method with all parameters.
FunctionMethod(java.lang.String name, java.lang.String description, java.lang.String category, java.lang.String invocationClass, java.lang.String invocationMethod, FunctionParameter[] inputParams, FunctionParameter outputParam)
          Construct a function method with default pushdown and null dependent attributes.
FunctionMethod(java.lang.String name, java.lang.String description, java.lang.String category, java.lang.String invocationClass, java.lang.String invocationMethod, FunctionParameter[] inputParams, FunctionParameter outputParam, int deterministic)
          Construct a function method with default pushdown and null dependent attributes.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare other object for equality.
 java.lang.String getCategory()
          Get category of method
 java.lang.String getDescription()
          Get description of method
 int getDeterministic()
           
 int getInputParameterCount()
          Get a count of the input parameters.
 FunctionParameter[] getInputParameters()
          Get input parameters
 java.lang.String getInvocationClass()
          Get invocation class name
 java.lang.String getInvocationMethod()
          Get invocation method name
 java.lang.String getName()
          Return name of method
 FunctionParameter getOutputParameter()
          Get ouput parameter.
 int getPushdown()
          Get pushdown property of method
 int hashCode()
          Get hash code for this object.
 boolean isNullDependent()
          Returns true if the function can produce a non-null output from a null parameter
 boolean isVarArgs()
           
 void setCategory(java.lang.String category)
          Set category of method
 void setDescription(java.lang.String description)
          Set description of method
 void setDeterministic(int deterministic)
           
 void setInputParameters(FunctionParameter[] params)
          Set input parameters.
 void setInvocationClass(java.lang.String invocationClass)
          Set invocation class name
 void setInvocationMethod(java.lang.String invocationMethod)
          Set invocation method name
 void setName(java.lang.String name)
          Set name of method
 void setNullDependent(boolean nullSafe)
           
 void setOutputParameter(FunctionParameter param)
          Set ouput parameter.
 void setPushdown(int pushdown)
          Set pushdown property of method
 java.lang.String toString()
          Return string version for debugging purposes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CAN_PUSHDOWN

public static final int CAN_PUSHDOWN
See Also:
Constant Field Values

CANNOT_PUSHDOWN

public static final int CANNOT_PUSHDOWN
See Also:
Constant Field Values

MUST_PUSHDOWN

public static final int MUST_PUSHDOWN
See Also:
Constant Field Values

SYNTHETIC

public static final int SYNTHETIC
See Also:
Constant Field Values

DETERMINISTIC

public static final int DETERMINISTIC
See Also:
Constant Field Values

SERVER_DETERMINISTIC

public static final int SERVER_DETERMINISTIC
See Also:
Constant Field Values

SESSION_DETERMINISTIC

public static final int SESSION_DETERMINISTIC
See Also:
Constant Field Values

COMMAND_DETERMINISTIC

public static final int COMMAND_DETERMINISTIC
See Also:
Constant Field Values

NONDETERMINISTIC

public static final int NONDETERMINISTIC
See Also:
Constant Field Values
Constructor Detail

FunctionMethod

public FunctionMethod()
Construct a new empty function method.


FunctionMethod

public FunctionMethod(java.lang.String name,
                      java.lang.String description,
                      java.lang.String category,
                      java.lang.String invocationClass,
                      java.lang.String invocationMethod,
                      FunctionParameter[] inputParams,
                      FunctionParameter outputParam)
Construct a function method with default pushdown and null dependent attributes.

Parameters:
name - Function name
description - Function description
category - Function category
invocationClass - Invocation class
invocationMethod - Invocation method
inputParams - Input parameters
outputParam - Output parameter (return parameter)

FunctionMethod

public FunctionMethod(java.lang.String name,
                      java.lang.String description,
                      java.lang.String category,
                      java.lang.String invocationClass,
                      java.lang.String invocationMethod,
                      FunctionParameter[] inputParams,
                      FunctionParameter outputParam,
                      int deterministic)
Construct a function method with default pushdown and null dependent attributes.

Parameters:
name - Function name
description - Function description
category - Function category
invocationClass - Invocation class
invocationMethod - Invocation method
inputParams - Input parameters
outputParam - Output parameter (return parameter)

FunctionMethod

public FunctionMethod(java.lang.String name,
                      java.lang.String description,
                      java.lang.String category,
                      int pushdown,
                      java.lang.String invocationClass,
                      java.lang.String invocationMethod,
                      FunctionParameter[] inputParams,
                      FunctionParameter outputParam)
Construct a function method with all parameters assuming null dependent and non-deterministic.

Parameters:
name - Function name
description - Function description
category - Function category
invocationClass - Invocation class
invocationMethod - Invocation method
inputParams - Input parameters
outputParam - Output parameter (return parameter)

FunctionMethod

public FunctionMethod(java.lang.String name,
                      java.lang.String description,
                      java.lang.String category,
                      int pushdown,
                      java.lang.String invocationClass,
                      java.lang.String invocationMethod,
                      FunctionParameter[] inputParams,
                      FunctionParameter outputParam,
                      boolean nullDependent,
                      int deterministic)
Construct a function method with all parameters.

Parameters:
name - Function name
description - Function description
category - Function category
invocationClass - Invocation class
invocationMethod - Invocation method
inputParams - Input parameters
outputParam - Output parameter (return parameter)
Method Detail

getName

public java.lang.String getName()
Return name of method

Returns:
Name

setName

public void setName(java.lang.String name)
Set name of method

Parameters:
name - Name

getDescription

public java.lang.String getDescription()
Get description of method

Returns:
Description

setDescription

public void setDescription(java.lang.String description)
Set description of method

Parameters:
description - Description

getCategory

public java.lang.String getCategory()
Get category of method

Returns:
Category
See Also:
FunctionCategoryConstants

setCategory

public void setCategory(java.lang.String category)
Set category of method

Parameters:
category - Category
See Also:
FunctionCategoryConstants

getPushdown

public int getPushdown()
Get pushdown property of method

Returns:
One of the FunctionMethod constants for pushdown

setPushdown

public void setPushdown(int pushdown)
Set pushdown property of method

Parameters:
pushdown - One of the FunctionMethod constants for pushdown

getInvocationClass

public java.lang.String getInvocationClass()
Get invocation class name

Returns:
Invocation class name

setInvocationClass

public void setInvocationClass(java.lang.String invocationClass)
Set invocation class name

Parameters:
invocationClass - Invocation class name

getInvocationMethod

public java.lang.String getInvocationMethod()
Get invocation method name

Returns:
Invocation method name

setInvocationMethod

public void setInvocationMethod(java.lang.String invocationMethod)
Set invocation method name

Parameters:
invocationMethod - Invocation method name

getInputParameterCount

public int getInputParameterCount()
Get a count of the input parameters.

Returns:
Number of input parameters

getInputParameters

public FunctionParameter[] getInputParameters()
Get input parameters

Returns:
Array of input parameters, may be null if 0 parameters

setInputParameters

public void setInputParameters(FunctionParameter[] params)
Set input parameters.

Parameters:
params - Input parameters

getOutputParameter

public FunctionParameter getOutputParameter()
Get ouput parameter.

Returns:
Output parameter or return argument

setOutputParameter

public void setOutputParameter(FunctionParameter param)
Set ouput parameter.

Parameters:
param - Output Parameter

hashCode

public int hashCode()
Get hash code for this object. The hash code is based on the name and input parameters. WARNING: Changing the name or input parameters will change the hash code. If this occurs after the object has been placed in a HashSet or HashMap, the object will be lost!!!! In that case, the object must be added to the hashed collection again.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code, based on name and input parameters

equals

public boolean equals(java.lang.Object obj)
Compare other object for equality. This object is equal to another FunctionMethod if 1) Name of function matches (case-insensitive), 2) number of input parameters matches and 3) types of input parameters match.

Overrides:
equals in class java.lang.Object
Returns:
True if object equals this object according to conditions

toString

public java.lang.String toString()
Return string version for debugging purposes

Overrides:
toString in class java.lang.Object
Returns:
String representation of function method

isNullDependent

public boolean isNullDependent()
Returns true if the function can produce a non-null output from a null parameter


setNullDependent

public void setNullDependent(boolean nullSafe)

getDeterministic

public int getDeterministic()

setDeterministic

public void setDeterministic(int deterministic)

isVarArgs

public boolean isVarArgs()


Copyright © 2009. All Rights Reserved.