***  This class is subject to change.  ***

com.sas.iquery.metadata.serverprop
Class FunctionSignature

com.sas.iquery.metadata.serverprop.FunctionSignature

@ThreadSafe
public class FunctionSignature

Models a single signature for a function or operator definition. Functions or operator definitions that have multiple valid signatures are modeled as a single Function or operator definition having multiple of these FunctionSignature objects.

See Also:
Function, Operator

Method Summary
 int getArgumentCount()
          Returns the number of parameters defined for this function signature.
 java.lang.String getDefaultSyntaxTemplate()
          Returns the syntax template for this FunctionSignature.
 java.util.List<Parameter> getParameters()
          Returns a list of ParameterType objects describing the parameters for this function signature.
 ParameterType getReturnType()
          Returns the ParameterType object describing the type returned for this function signature.
 java.lang.String getSyntaxTemplateFor(java.util.List<ExpressionInterface> parms)
          Returns the syntax template for the FunctionSignature with the specified set of argument types given as Integer objects containing values from the ExpressionTypes class.
 boolean isCompatibleWith(java.util.List<ExpressionInterface> args)
          Returns an indication of whether the list of argument expression types (expressed as a list Integer objects, each containing a constant from the ExpressionTypes class) is valid with this signature.
 

Method Detail

***  This method is subject to change.  ***

getReturnType

public ParameterType getReturnType()
Returns the ParameterType object describing the type returned for this function signature.

Returns:
a ParameterType object that describes the type returned for this function signature

***  This method is subject to change.  ***

getParameters

public java.util.List<Parameter> getParameters()
Returns a list of ParameterType objects describing the parameters for this function signature.

Returns:
a list of ParameterType objects describing the parameters for this function signature.

***  This method is subject to change.  ***

getArgumentCount

public int getArgumentCount()
Returns the number of parameters defined for this function signature. If one or more of the parameters are defined as being varying -1 is returned.

Returns:
number of arguments or -1 if the argument count can vary.

***  This method is subject to change.  ***

getDefaultSyntaxTemplate

public java.lang.String getDefaultSyntaxTemplate()
Returns the syntax template for this FunctionSignature. A syntax template is a template that can be substituted into for SQL or MDX code generation or other purposes.

Returns:
the syntax template for the FunctionSignature.

getSyntaxTemplateFor

public java.lang.String getSyntaxTemplateFor(java.util.List<ExpressionInterface> parms)
Returns the syntax template for the FunctionSignature with the specified set of argument types given as Integer objects containing values from the ExpressionTypes class. This method handles returning syntax templates for varying length parameter lists ... and returns a syntax template for the given set of parameters. If no template is defined for the specified number of parameters null is returned.

Parameters:
parms - a list of argument types, expressed as Integer objects containing expression types from the ExpressionTypes class.
Returns:
the syntax template for the specified FunctionSignature and number of parameters. Otherwise null
See Also:
ExpressionTypes

isCompatibleWith

public boolean isCompatibleWith(java.util.List<ExpressionInterface> args)
Returns an indication of whether the list of argument expression types (expressed as a list Integer objects, each containing a constant from the ExpressionTypes class) is valid with this signature. Only the parameter types in this signature are checked for compatibility with the given expression types.

Parameters:
args - a list of argument types, expressed as Integer objects containing expression types from the ExpressionTypes class.
Returns:
a boolean indication of whether the given list of expression types describing argument types are compatible with the parameter types in this function signature.
See Also:
ExpressionTypes

***  This class is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.