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
Functionwhich computes an aggregated value over agroupofsolutionsduring query execution.- Since:
- 1.1
- Version:
- 6.0
- Author:
- Michael Grove, Pavel Klinov
- See Also:
Aggregates
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAggregate.ErrorBehaviourDefine behaviour of this aggregate when the input is unbound / erroneous
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Disposes of the internal state.Aggregatecopy()Create a deep copy of the object which does not share any references with the original.com.complexible.stardog.plan.filter.expr.ValueOrErrorevaluate(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.ValueOrErrorget()Get the aggregated valuecom.complexible.stardog.plan.filter.ExpressiongetArg()Get the argument expressionAggregate.ErrorBehaviourgetErrorBehaviour()default booleanisAppropriateDataType(Datatype theDataType)booleanisDistinct()Return whether or not the Aggregate has a distinct modifier applied to itdefault booleanisFixedSizeAggregate()voidreset()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 totalor 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:
evaluatein 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;
-
getErrorBehaviour
Aggregate.ErrorBehaviour getErrorBehaviour()
- Returns:
- value indicating whether this aggregate can produce unbound or error results
-
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:
closein interfacejava.lang.AutoCloseable
-
-