Class IntegerAverageOperator
java.lang.Object
tools.refinery.interpreter.matchers.aggregators.IntegerAverageOperator
- All Implemented Interfaces:
IMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>, Double>
public class IntegerAverageOperator
extends Object
implements IMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>,Double>
- Since:
- 2.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaggregateStream(Stream<Integer> stream) Calculates the aggregate results from a given stream of values; all values are considered as insertedtools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> Clones the given accumulator (with all its internal contents).tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> getAggregate(tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> result) getName()A name or identifier of the operator.A textual description of the operator.booleantools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> update(tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> oldResult, Integer updateValue, boolean isInsertion) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tools.refinery.interpreter.matchers.psystem.aggregations.IMultisetAggregationOperator
combine, contains, prettyPrint
-
Field Details
-
INSTANCE
-
-
Method Details
-
getShortDescription
Description copied from interface:IMultisetAggregationOperatorA textual description of the operator.- Specified by:
getShortDescriptionin interfaceIMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>, Double>
-
getName
Description copied from interface:IMultisetAggregationOperatorA name or identifier of the operator.- Specified by:
getNamein interfaceIMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>, Double>
-
createNeutral
- Specified by:
createNeutralin interfaceIMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>, Double> - Returns:
- the neutral element, i.e. the interim result of aggregating an empty multiset.
-
isNeutral
public boolean isNeutral(tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> result) - Specified by:
isNeutralin interfaceIMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>, Double> - Returns:
- true if the interim result is equivalent to the neutral element, as if there are no values in the multiset. Must return true if the multiset is empty.
-
update
public tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> update(tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> oldResult, Integer updateValue, boolean isInsertion) - Specified by:
updatein interfaceIMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>, Double> - Returns:
- an updated intermediate result, changed to reflect that a given object was added to / removed from the multiset (as indicated by the parameter isInsertion)
-
getAggregate
public Double getAggregate(tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> result) - Specified by:
getAggregatein interfaceIMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>, Double> - Returns:
- the aggregate result obtained from the given intermediate result. May be null to indicate that the current multiset cannot be aggregated (e.g. 0 elements have no minimum).
-
aggregateStream
Description copied from interface:IMultisetAggregationOperatorCalculates the aggregate results from a given stream of values; all values are considered as inserted- Specified by:
aggregateStreamin interfaceIMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>, Double> - Returns:
- the aggregate result, or null if no result can be calculated (e.g. because of an empty stream)
-
clone
public tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> clone(tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer> original) Description copied from interface:IMultisetAggregationOperatorClones the given accumulator (with all its internal contents).- Specified by:
clonein interfaceIMultisetAggregationOperator<Integer,tools.refinery.interpreter.matchers.aggregators.AverageAccumulator<Integer>, Double> - Since:
- 2.4
-