org.teiid.language
Class AggregateFunction

java.lang.Object
  extended by org.teiid.language.BaseLanguageObject
      extended by org.teiid.language.AggregateFunction
All Implemented Interfaces:
Expression, LanguageObject

public class AggregateFunction
extends BaseLanguageObject
implements Expression

Represents an aggregate function.


Field Summary
static java.lang.String AVG
           
static java.lang.String COUNT
           
static java.lang.String MAX
           
static java.lang.String MIN
           
static java.lang.String STDDEV_POP
           
static java.lang.String STDDEV_SAMP
           
static java.lang.String SUM
           
static java.lang.String VAR_POP
           
static java.lang.String VAR_SAMP
           
 
Constructor Summary
AggregateFunction(java.lang.String aggName, boolean isDistinct, Expression exp, java.lang.Class<?> type)
           
 
Method Summary
 void acceptVisitor(LanguageObjectVisitor visitor)
           
 Expression getCondition()
           
 Expression getExpression()
          Get the expression within the aggregate function.
 java.lang.String getName()
          Get the name of the aggregate function.
 java.lang.Class<?> getType()
          Determine the type returned by this expression.
 boolean isDistinct()
          Determine whether this function was executed with DISTINCT.
 void setCondition(Expression condition)
           
 void setDistinct(boolean isDistinct)
          Set whether this function was executed with DISTINCT.
 void setExpression(Expression expression)
          Set the expression within the aggregate function.
 void setName(java.lang.String name)
          Set the name of the aggregate function.
 void setType(java.lang.Class<?> type)
           
 
Methods inherited from class org.teiid.language.BaseLanguageObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COUNT

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

AVG

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

SUM

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

MIN

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

MAX

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

STDDEV_POP

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

STDDEV_SAMP

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

VAR_SAMP

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

VAR_POP

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

AggregateFunction

public AggregateFunction(java.lang.String aggName,
                         boolean isDistinct,
                         Expression exp,
                         java.lang.Class<?> type)
Method Detail

getName

public java.lang.String getName()
Get the name of the aggregate function. This will be one of the constants defined in this class.


isDistinct

public boolean isDistinct()
Determine whether this function was executed with DISTINCT. Executing with DISTINCT will remove all duplicate values in a group when evaluating the aggregate function.

Returns:
True if DISTINCT mode is used

getExpression

public Expression getExpression()
Get the expression within the aggregate function. The expression will be null for the special case COUNT(*). This is the only case where the expression will be null

Returns:
The expression or null for COUNT(*)

acceptVisitor

public void acceptVisitor(LanguageObjectVisitor visitor)
Specified by:
acceptVisitor in interface LanguageObject

setName

public void setName(java.lang.String name)
Set the name of the aggregate function. This will be one of the constants defined in this class.

Parameters:
name - New aggregate function name

setDistinct

public void setDistinct(boolean isDistinct)
Set whether this function was executed with DISTINCT. Executing with DISTINCT will remove all duplicate values in a group when evaluating the aggregate function.

Parameters:
isDistinct - True if DISTINCT mode should be used

setExpression

public void setExpression(Expression expression)
Set the expression within the aggregate function. The expression will be null for the special case COUNT(*).

Parameters:
expression - The new expression

getType

public java.lang.Class<?> getType()
Description copied from interface: Expression
Determine the type returned by this expression.

Specified by:
getType in interface Expression
Returns:
The type, as defined by a Java class

setType

public void setType(java.lang.Class<?> type)

getCondition

public Expression getCondition()
Returns:
the filter clause condition

setCondition

public void setCondition(Expression condition)


Copyright © 2011. All Rights Reserved.