aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/psystem/aggregations/IAggregatorFactory.java
blob: c970bd6a3705a6ad9d5305b71fa371d22b0c2684 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*******************************************************************************
 * Copyright (c) 2010-2016, Zoltan Ujhelyi, Tamas Szabo, Istvan Rath and Daniel Varro
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-v20.html.
 * 
 * SPDX-License-Identifier: EPL-2.0
 *******************************************************************************/
package tools.refinery.viatra.runtime.matchers.psystem.aggregations;

/**
 * 
 * Describes an aggregation operator keyword, potentially with type polymorphism. The actual runtime
 * {@link IMultisetAggregationOperator} that implements the aggregation logic may depend on the type context.
 * 
 * <p>
 * Implementors are suggested to use lower-case classnames (as it will end up in the language) and are required use the
 * annotation {@link AggregatorType} to indicate type inference rules.
 * 
 * <p>
 * <strong>Important!</strong> Implemented aggregators must be (1) deterministic (2) pure and (3)support incremental
 * value updates in the internal operation.
 * 
 * @author Zoltan Ujhelyi
 * @since 1.4
 */

public interface IAggregatorFactory {

    /**
     * Given type parameters selected from {@link AggregatorType} annotations, returns a run-time aggregator operator
     * that is bound to the actual types.
     * 
     * @param domainClass
     *            Java type of the values that are being aggregated
     * @return the actual run-time aggregator logic, with type bindings
     */
    public BoundAggregator getAggregatorLogic(Class<?> domainClass);

}