|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.navigation.analytics.ExprAggregate
public class ExprAggregate
Instances of the ExprAggregate
class represent
aggregate functions over the members of the associated
aggregated record.
Nested Class Summary | |
---|---|
static class |
ExprAggregate.ExprAggregateOp
Enumeration of Endeca aggregate functions. |
Field Summary | |
---|---|
static ExprAggregate.ExprAggregateOp |
ARB
Arbitrary function. |
static ExprAggregate.ExprAggregateOp |
AVG
Average function. |
static ExprAggregate.ExprAggregateOp |
COUNT
Count function. |
static ExprAggregate.ExprAggregateOp |
COUNTDISTINCT
Count Distinct function. |
static ExprAggregate.ExprAggregateOp |
MAX
Maximum function. |
static ExprAggregate.ExprAggregateOp |
MEDIAN
Median function. |
static ExprAggregate.ExprAggregateOp |
MIN
Minimum function. |
static ExprAggregate.ExprAggregateOp |
STDDEV
Standard Deviation function. |
static ExprAggregate.ExprAggregateOp |
SUM
Sum function. |
static ExprAggregate.ExprAggregateOp |
VARIANCE
Variance function. |
Constructor Summary | |
---|---|
ExprAggregate(ExprAggregate.ExprAggregateOp function,
Expr expr)
Creates a new ExprAggregate . |
Method Summary | |
---|---|
Expr |
getExpr()
Gets the subexpression for this ExprAggregate . |
Filter |
getFilter()
Gets the Filter associated with this
Expr . |
ExprAggregate.ExprAggregateOp |
getFunction()
Gets the aggregate function for this ExprAggregate . |
void |
setExpr(Expr expr)
Sets the subexpression for this ExprAggregate . |
void |
setFilter(Filter filter)
Adds a Filter to this expression, causing only records
that satisfy the filter to be taken into account by this aggregate. |
void |
setFunction(ExprAggregate.ExprAggregateOp function)
Sets the aggregate function for this ExprAggregate . |
String |
toString()
Returns the string form of this ExprAggregate . |
String |
toWire()
Returns the wire form of this ExprAggregate . |
void |
validateSyntax()
Validates the syntax of this ExprAggregate . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ExprAggregate.ExprAggregateOp SUM
public static final ExprAggregate.ExprAggregateOp AVG
public static final ExprAggregate.ExprAggregateOp VARIANCE
public static final ExprAggregate.ExprAggregateOp STDDEV
public static final ExprAggregate.ExprAggregateOp MIN
public static final ExprAggregate.ExprAggregateOp MAX
public static final ExprAggregate.ExprAggregateOp COUNT
public static final ExprAggregate.ExprAggregateOp COUNTDISTINCT
public static final ExprAggregate.ExprAggregateOp MEDIAN
public static final ExprAggregate.ExprAggregateOp ARB
Constructor Detail |
---|
public ExprAggregate(ExprAggregate.ExprAggregateOp function, Expr expr)
ExprAggregate
. The ExprAggregate
will
compute the aggregate function specified by function
over the evaluation
of the subexpression expr
on the members of the
aggregated record.
Note that ExprAggregate
nodes may not be nested. That is,
neither the specified subexpression expr
nor any
of its descendant subexpressions may be instances of
ExprAggregate
; otherwise, the resulting expression
is semantically invalid (note that this will not be caught by
the validateSyntax
method).
function
- an aggregate function of type ExprAggregate.ExprAggregateOp
.expr
- an object of type Expr
that will be
the subexpression for this ExprAggregate
.Method Detail |
---|
public void setFunction(ExprAggregate.ExprAggregateOp function)
ExprAggregate
.
function
- an aggregate function of type ExprAggregate.ExprAggregateOp
that specifies the type of operation to be made.
The functions are: ExprAggregate.ARB
,
ExprAggregate.AVG
, ExprAggregate.COUNT
,
ExprAggregate.COUNTDISTINCT
, ExprFunction.EXTRACT
,
ExprAggregate.MAX
, ExprAggregate.MEDIAN
,
ExprAggregate.MIN
, ExprAggregate.STDDEV
,
ExprAggregate.ROUND
, ExprFunction.SIGN
,
ExprFunction.SUM
, and ExprAggregate.VARIANCE
.public ExprAggregate.ExprAggregateOp getFunction()
ExprAggregate
.
ExprAggregate.ExprAggregateOp
)
for this ExprAggregate
.
See the setFunction
method for a list of the
function names.public void setExpr(Expr expr)
ExprAggregate
.
The aggregate function will be evaluated on this subexpression.
expr
- an object of type Expr
that will be
the subexpression for this ExprAggregate
.public Expr getExpr()
ExprAggregate
.
The aggregate function will be evaluated on this subexpression.
Expr
)
for this ExprAggregate
.public void setFilter(Filter filter)
Filter
to this expression, causing only records
that satisfy the filter to be taken into account by this aggregate.
filter
- the Filter
to be set.public Filter getFilter()
Filter
associated with this
Expr
. Only records in the associated aggregate
that satisfy the returned Filter
contribute to the
derived value represented by this Expr
.
Filter
object.public String toString()
ExprAggregate
. The format is:
FUNCTION(subexpression)where FUNCTION is an aggregate function name.
The format for an ExprAggregate
with a filter is:
FUNCTION(subexpression) WHERE filterwhere filter is the filter added by the
setFilter
method.
toString
in interface QueryNode
toString
in class Object
ExprBinary
in the specified format.public String toWire()
ExprAggregate
. This method is not
intended for public use because the wire format is subject to change.
toWire
in interface QueryNode
ExprAggregate
.public void validateSyntax() throws SyntaxException
ExprAggregate
.
An ExprAggregate
is valid if the function is
not null and the subexpression is non-null and itself valid.
validateSyntax
in interface QueryNode
SyntaxException
- if the syntax requirements are not satisfied.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |