***  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, ExpressionInterface... args)
          FunctionCall constructor with variable arguments
FunctionCall(Function function, java.util.List<? extends 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 data items 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<DataItem> getLeafDataItems()
          Return a list of leaf data items.
 void setArguments(java.util.List<? extends 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,
                    ExpressionInterface... args)
FunctionCall constructor with variable arguments

Parameters:
function, - function definition for this expression
args, - arguments needed by this function

FunctionCall

public FunctionCall(Function function,
                    java.util.List<? extends 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<? extends 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 data items 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 performing this operation
See Also:
DataItemContainerExpression.containsUserTypedAggregation()

getLeafDataItems

public java.util.List<DataItem> getLeafDataItems()
Description copied from interface: DataItemContainerExpression
Return a list of leaf data items. A leaf data item is a data item which does not contain measure data items as part of their expression.

The typical usage is to get those data items which can return detail information by ignoring their aggregate function.

The returned list does not contain duplicates. If the same leaf data item appears more than once in the expression, the returned list will contain the data item only once.

A data item 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 data items. The list may be empty, but is never null. The list does not contain duplicate data items.
See Also:
DataItemContainerExpression.getLeafDataItems()

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.