aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/traceability/CompiledQuery.java
blob: b8c793c5f6ba135af8e49fb585afbe12e7f9fc8e (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 2010-2014, Bergmann Gabor, 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.rete.traceability;

import java.util.Map;

import tools.refinery.viatra.runtime.matchers.psystem.PBody;
import tools.refinery.viatra.runtime.matchers.psystem.queries.PQuery;
import tools.refinery.viatra.runtime.rete.recipes.ReteNodeRecipe;

/**
 * Indicates that recipe expresses the finished match set of a query.
 * @author Bergmann Gabor
 * @noinstantiate This class is not intended to be instantiated by clients.
 */
public class CompiledQuery extends RecipeTraceInfo implements
        PatternTraceInfo {
    
    private PQuery query;
    private final Map<PBody, ? extends RecipeTraceInfo> parentRecipeTracesPerBody;
    
    /**
     * @since 1.6
     */
    public CompiledQuery(ReteNodeRecipe recipe,
            Map<PBody, ? extends RecipeTraceInfo> parentRecipeTraces,
            PQuery query) {
        super(recipe, parentRecipeTraces.values());
        parentRecipeTracesPerBody = parentRecipeTraces;
        this.query = query;
    }
    public PQuery getQuery() {
        return query;
    }

    @Override
    public String getPatternName() {
        return query.getFullyQualifiedName();
    }

    /**
     * @since 1.6
     */
    public Map<PBody, ? extends RecipeTraceInfo> getParentRecipeTracesPerBody() {
        return parentRecipeTracesPerBody;
    }

}