Interface Aggregate
-
- All Superinterfaces:
java.lang.AutoCloseable
,Copyable<com.complexible.stardog.plan.filter.Expression>
,com.complexible.stardog.plan.filter.Expression
,Function
public interface Aggregate extends Function, java.lang.AutoCloseable
A
Function
which computes an aggregated value over agroup
ofsolutions
during query execution.- Since:
- 1.1
- Version:
- 6.0
- Author:
- Michael Grove, Pavel Klinov
- See Also:
Aggregates
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
Disposes of the internal state.Aggregate
copy()
Create a deep copy of the object which does not share any references with the original.com.complexible.stardog.plan.filter.expr.ValueOrError
evaluate(com.complexible.stardog.plan.filter.ValueSolution theValueSolution)
The return value of evaluating an Aggregate is not necessarily the aggregated value, and can even be null.com.complexible.stardog.plan.filter.expr.ValueOrError
get()
Get the aggregated valuecom.complexible.stardog.plan.filter.Expression
getArg()
Get the argument expressiondefault boolean
isAppropriateDataType(Datatype theDataType)
boolean
isDistinct()
Return whether or not the Aggregate has a distinct modifier applied to itdefault boolean
isFixedSizeAggregate()
void
reset()
Resets the internal state of the aggregate so it can start over.-
Methods inherited from interface com.complexible.stardog.plan.filter.Expression
accept, couldRaiseError, getArgs, replaceArg, setArgs
-
Methods inherited from interface com.complexible.stardog.plan.filter.functions.Function
getName, getNames, initialize, isDeterministic
-
-
-
-
Method Detail
-
evaluate
com.complexible.stardog.plan.filter.expr.ValueOrError evaluate(com.complexible.stardog.plan.filter.ValueSolution theValueSolution)
The return value of evaluating an Aggregate is not necessarily the aggregated value, and can even be null. In many cases the aggregate may be computing a value, as withAvg
, rather than something like arunning total
or avalue from the group
. In these instances, it is not worth computing the aggregated value since it's not used until the entire group is processed and retrieved viaget()
. Some aggregates may choose to return the current aggregated value here, but null will often be the return value of this method for aggregates.- Specified by:
evaluate
in interfacecom.complexible.stardog.plan.filter.Expression
-
get
com.complexible.stardog.plan.filter.expr.ValueOrError get()
Get the aggregated value- Returns:
- the value
-
isDistinct
boolean isDistinct()
Return whether or not the Aggregate has a distinct modifier applied to it- Returns:
- true if distinct, false otherwise
-
isFixedSizeAggregate
default boolean isFixedSizeAggregate()
- Returns:
- true if corresponding aggregate is being applied to the decimal value with fixed size, else otherwise;
-
isAppropriateDataType
default boolean isAppropriateDataType(Datatype theDataType)
- Parameters:
theDataType
- - dataType;- Returns:
- true if corresponding aggregate can be applied for the corresponding type during Functor's calculation, false otherwise;
-
copy
Aggregate copy()
Create a deep copy of the object which does not share any references with the original.
-
getArg
com.complexible.stardog.plan.filter.Expression getArg()
Get the argument expression- Returns:
- the argument expression
-
reset
void reset()
Resets the internal state of the aggregate so it can start over.
-
close
void close()
Disposes of the internal state.- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-