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

com.sas.iquery.metadata.expr
Class FunctionCall

com.sas.iquery.metadata.expr.FunctionCall
All Implemented Interfaces:
Base, BusinessModelResourceReferencer, ModelItem, UsabilityInterface, DataItemContainerExpression, ExpressionInterface, PropertyChangeListenee, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

@NotThreadSafe
public class FunctionCall
implements DataItemContainerExpression, BusinessModelResourceReferencer

Models a call to a function that is specified by a given function definition and some, possibly empty, set of arguments that meets the requirements of a FunctionSignature that is associated with the given Function.

No enforcement of the arguments meeting the requirements of the function signature is currently done by SAS Query Services. It is possible to cause invalid queries, only catchable by the end data server, by not giving proper arguments to objects of this class.


Field Summary
static java.lang.String EVENT_ARGUMENTS_CHANGED
           
static java.lang.String EVENT_FUNCTION_CHANGED
           
 
Fields inherited from interface com.sas.iquery.metadata.business.ModelItem
EVENT_OBJECT_PROPERTY_CHANGED
 
Fields inherited from interface com.sas.iquery.metadata.business.Base
EVENT_OBJECT_DEFINITION_CHANGED
 
Constructor Summary
FunctionCall()
          Constructor for use when function is to be set later
FunctionCall(Function function)
          Instantiates a new FunctionCall object with the input function and no arguments.
FunctionCall(Function function, ExpressionInterface arg1)
          Instantiates a new FunctionCall object with the input function and one argument.
FunctionCall(Function function, ExpressionInterface arg1, ExpressionInterface arg2)
          Instantiates a new FunctionCall object with the input function and two arguments.
FunctionCall(Function function, ExpressionInterface arg1, ExpressionInterface arg2, ExpressionInterface arg3)
          Instantiates a new FunctionCall object with the input function and three arguments.
FunctionCall(Function function, java.util.List<ExpressionInterface> arguments)
          Instantiates a new FunctionCall object with the input function and list of arguments.
 
Method Summary
 boolean containsUserTypedAggregation()
          Return true if this expression or any of its dataitems have an aggregation in their expression text.
 java.util.List<ExpressionInterface> getArguments()
          Returns a (possibly empty) list of arguments that have been set on this function call.
 int getExpressionType()
          Return the integer form of the expression type.
 Function getFunction()
          Returns the Function object contained in this function call.
 FunctionSignature getFunctionSignature()
           
 java.util.List<ExpressionInterface> getLeafDataItems()
          Return a list of leaf data items (dataitems which do not contain measure dataitems as part of their expression).
 void setArguments(java.util.List<ExpressionInterface> arguments)
          Set the arguments on this function call
 void setFunction(Function function)
          Sets the function on this function call.
 
Methods inherited from interface com.sas.iquery.metadata.business.BusinessModelResourceReferencer
getResources
 
Methods inherited from interface com.sas.iquery.metadata.PropertyChangeListenee
addListener, getListeners, removeListener
 
Methods inherited from interface com.sas.iquery.metadata.business.UsabilityInterface
getReasonsUnusable, isUsableInQuery
 

Field Detail

EVENT_FUNCTION_CHANGED

public static final java.lang.String EVENT_FUNCTION_CHANGED
See Also:
Constant Field Values

EVENT_ARGUMENTS_CHANGED

public static final java.lang.String EVENT_ARGUMENTS_CHANGED
See Also:
Constant Field Values
Constructor Detail

FunctionCall

public FunctionCall()
Constructor for use when function is to be set later


FunctionCall

public FunctionCall(Function function)
Instantiates a new FunctionCall object with the input function and no arguments.


FunctionCall

public FunctionCall(Function function,
                    ExpressionInterface arg1)
Instantiates a new FunctionCall object with the input function and one argument.


FunctionCall

public FunctionCall(Function function,
                    ExpressionInterface arg1,
                    ExpressionInterface arg2)
Instantiates a new FunctionCall object with the input function and two arguments.


FunctionCall

public FunctionCall(Function function,
                    ExpressionInterface arg1,
                    ExpressionInterface arg2,
                    ExpressionInterface arg3)
Instantiates a new FunctionCall object with the input function and three arguments.


FunctionCall

public FunctionCall(Function function,
                    java.util.List<ExpressionInterface> arguments)
Instantiates a new FunctionCall object with the input function and list of arguments.

Method Detail

getFunction

public Function getFunction()
Returns the Function object contained in this function call.

Returns:
the Function object

setFunction

public void setFunction(Function function)
Sets the function on this function call.

Parameters:
function - Function object

getArguments

public java.util.List<ExpressionInterface> getArguments()
Returns a (possibly empty) list of arguments that have been set on this function call.

Returns:
List (possibly empty) of ExpressionInterface objects

setArguments

public void setArguments(java.util.List<ExpressionInterface> arguments)
Set the arguments on this function call

Parameters:
arguments - List, each item must be an ExpressionInterface

getFunctionSignature

public FunctionSignature getFunctionSignature()
Returns:
the FunctionSignature object
See Also:
FunctionSignature

getExpressionType

public int getExpressionType()
Description copied from interface: ExpressionInterface
Return the integer form of the expression type.

Specified by:
getExpressionType in interface ExpressionInterface
Returns:
an expression type from class ExpressionTypes
See Also:
ExpressionInterface.getExpressionType()

containsUserTypedAggregation

public boolean containsUserTypedAggregation()
                                     throws MetadataException
Description copied from interface: DataItemContainerExpression
Return true if this expression or any of its dataitems have an aggregation in their expression text. For example, the user may have typed "SUM(X) + SUM(Y)" in the expression editor.

Specified by:
containsUserTypedAggregation in interface DataItemContainerExpression
Returns:
true, if there is at least one user typed aggregation, false otherwise
Throws:
MetadataException - on any failures while perfoming this operation
See Also:
DataItemContainerExpression.containsUserTypedAggregation()

getLeafDataItems

public java.util.List<ExpressionInterface> getLeafDataItems()
Description copied from interface: DataItemContainerExpression
Return a list of leaf data items (dataitems which do not contain measure dataitems as part of their expression).

This will allow us to get dataitems which can return detail information by ignoring their aggregate function. Duplicates will be removed. If the same leaf dataitem appears more than once in the expression, the returned list will contain the dataitem only once.

DataItem can be both an expression and a leaf data item. Therefore, a data item when treated as an expression, may return itself from this method.

Specified by:
getLeafDataItems in interface DataItemContainerExpression
Returns:
List of DataItem objects or an empty list if none found.
See Also:
DataItemContainerExpression.getLeafDataItems()

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.