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

com.sas.iquery.metadata.serverprop
Class Function

com.sas.iquery.metadata.serverprop.Function
All Implemented Interfaces:
LocalizableNamedObjectInterface, NamedObjectInterface, com.sas.util.LocalizableToStringInterface
Direct Known Subclasses:
Operator

@ThreadSafe
public class Function
implements LocalizableNamedObjectInterface

Models a function definition that can be used within expressions to perform more complex queries.

To model an expression using a function definition use the FunctionCall class.

See Also:
FunctionCall, Operator

Method Summary
 int getArgumentCount()
          Returns -1 when the function has signatures with varying argument counts
 Category getCategory()
          Returns the category this function is "contained" within.
 FunctionSignature getCompatibleSignature(java.util.List<ExpressionInterface> args)
          Returns a compatible function signature from the list of function signatures defined for this function that is compatible with the types of arguments given in the input list.
 java.lang.String getDescription()
          Returns a localized description of this function.
 java.lang.String getDescription(java.util.Locale locale)
          Returns a description for this object for a specific locale, typically for display purposes.
 com.sas.util.LocalizableString getDescriptions()
          Returns the entire set of descriptions for this object for all locales, typically for display purposes.
 FunctionNameID getFunctionNameID()
          Return the associated FunctionNameID class for this function.
 java.lang.String getID()
          Returns the fully qualified id of this function.
 java.lang.String getLabel()
          Returns a localized label of this function.
 java.lang.String getLabel(java.util.Locale locale)
          Returns a label for this object for a specific locale, typically for display purposes.
 com.sas.util.LocalizableString getLabels()
          Returns the entire set of labels for this object for all locales, typically for display purposes.
 java.lang.String getNameID()
          Returns the name id of the function.
 java.util.List<FunctionSignature> getSignatures()
          Returns the list of FunctionSignature objects associated with this Function.
 java.lang.String getSyntaxTemplateFor(int numberOfArguments)
          Returns the syntax template for this Function with the specified number of arguments.
 java.lang.String getSyntaxToken()
          Returns the syntax token for this function when used in a SQL or MDX-generated query.
 java.lang.String getToolTip()
          Returns a localized string usable as a tooltip for this function.
 java.lang.String getToolTip(java.util.Locale locale)
           
 boolean isDistinct()
          Returns whether this function performs a "distinct" operation, such as in the sql COUNT DISTINCT function.
 boolean isInCategory(Category cat)
          Returns whether this function is within the given category.
 

Method Detail

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

getSyntaxToken

public java.lang.String getSyntaxToken()
Returns the syntax token for this function when used in a SQL or MDX-generated query.

Returns:
the syntax token for this function. null is returned for unresolved functions

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

isDistinct

public boolean isDistinct()
Returns whether this function performs a "distinct" operation, such as in the sql COUNT DISTINCT function.

Returns:
a boolean indicating whether this function performs the "distinct" operation.

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

getCategory

public Category getCategory()
Returns the category this function is "contained" within. See the Category class for more details.

Returns:
the category the function is container within
See Also:
Category

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

getLabel

public java.lang.String getLabel()
Returns a localized label of this function.

Specified by:
getLabel in interface NamedObjectInterface
Returns:
String a label or null if not set

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

getLabel

public java.lang.String getLabel(java.util.Locale locale)
Description copied from interface: LocalizableNamedObjectInterface
Returns a label for this object for a specific locale, typically for display purposes.

Specified by:
getLabel in interface LocalizableNamedObjectInterface
Parameters:
locale - the Locale of the label, null will use Locale.getDefault()
Returns:
String the label for the given locale or the same as getLabel() if no label set for the locale
See Also:
LocalizableNamedObjectInterface.getLabel(java.util.Locale)

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

getToolTip

public java.lang.String getToolTip()
Returns a localized string usable as a tooltip for this function. A function's tooltip tends to have less text than it's description.

Returns:
a localized string usable as a tooltip for this function.

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

getToolTip

public java.lang.String getToolTip(java.util.Locale locale)

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

getDescription

public java.lang.String getDescription()
Returns a localized description of this function.

Specified by:
getDescription in interface NamedObjectInterface
Returns:
a description or null if not set

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

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Description copied from interface: LocalizableNamedObjectInterface
Returns a description for this object for a specific locale, typically for display purposes. A description is intended to provide a longer worded phrase than the label itself.

Specified by:
getDescription in interface LocalizableNamedObjectInterface
Parameters:
locale - the Locale of the description, null will use Locale.getDefault()
Returns:
String the description for the given locale or the same as getDescription() if no description set for the locale
See Also:
LocalizableNamedObjectInterface.getDescription(java.util.Locale)

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

getSignatures

public java.util.List<FunctionSignature> getSignatures()
Returns the list of FunctionSignature objects associated with this Function.

Returns:
A list of FunctionSignatures

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

getArgumentCount

public int getArgumentCount()
Returns -1 when the function has signatures with varying argument counts


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

getID

public java.lang.String getID()
Returns the fully qualified id of this function. The ID is in the form <serverID>.<nameID>

Returns:
fully qualified id.

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

getNameID

public java.lang.String getNameID()
Returns the name id of the function.

Returns:
the name id

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

getFunctionNameID

public FunctionNameID getFunctionNameID()
Return the associated FunctionNameID class for this function. If no FunctionNameID class is associated with this function null is returned.

Returns:
the FunctionNameID class for this function or null.

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

isInCategory

public boolean isInCategory(Category cat)
Returns whether this function is within the given category.

Parameters:
cat - the category to test for
Returns:
a boolean indicating whether this function is within the given category.

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

getSyntaxTemplateFor

public java.lang.String getSyntaxTemplateFor(int numberOfArguments)
Returns the syntax template for this Function with the specified number of arguments. If no template is defined for the specified number of arguments an empty string is returned.

Returns:
the syntax template for the specified number of arguments.

getCompatibleSignature

public FunctionSignature getCompatibleSignature(java.util.List<ExpressionInterface> args)
Returns a compatible function signature from the list of function signatures defined for this function that is compatible with the types of arguments given in the input list.

Parameters:
args - a list of arguments used in determining a compatible function signature to return
Returns:
a compatible function signature or null if none is found

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

getLabels

public com.sas.util.LocalizableString getLabels()
Description copied from interface: LocalizableNamedObjectInterface
Returns the entire set of labels for this object for all locales, typically for display purposes.

Specified by:
getLabels in interface LocalizableNamedObjectInterface
Returns:
a copy of the LocalizableString containing the labels
See Also:
LocalizableNamedObjectInterface.getLabels()

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

getDescriptions

public com.sas.util.LocalizableString getDescriptions()
Description copied from interface: LocalizableNamedObjectInterface
Returns the entire set of descriptions for this object for all locales, typically for display purposes. A description is intended to provide a longer worded phrase than the label itself.

Specified by:
getDescriptions in interface LocalizableNamedObjectInterface
Returns:
a copy of the LocalizableString containing the descriptions
See Also:
LocalizableNamedObjectInterface.getDescriptions()

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.