diff options
author | 2023-09-07 01:22:52 +0200 | |
---|---|---|
committer | 2023-09-07 01:22:52 +0200 | |
commit | ccf1da01870d77b99e6a1a3b78e58caf9c9ed83e (patch) | |
tree | a4c4d2b0b8382342de6887eda584132a07ee847d /subprojects/store-dse/src/main/java/tools | |
parent | Merge pull request #2 from nagilooh/datastructure (diff) | |
download | refinery-ccf1da01870d77b99e6a1a3b78e58caf9c9ed83e.tar.gz refinery-ccf1da01870d77b99e6a1a3b78e58caf9c9ed83e.tar.zst refinery-ccf1da01870d77b99e6a1a3b78e58caf9c9ed83e.zip |
Sample tests for the dse adapter
Diffstat (limited to 'subprojects/store-dse/src/main/java/tools')
-rw-r--r-- | subprojects/store-dse/src/main/java/tools/refinery/store/dse/transition/objectives/QueryCriteria.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/transition/objectives/QueryCriteria.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/transition/objectives/QueryCriteria.java index e2260cca..e6dddd53 100644 --- a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/transition/objectives/QueryCriteria.java +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/transition/objectives/QueryCriteria.java | |||
@@ -12,27 +12,27 @@ import tools.refinery.store.query.ModelQueryBuilder; | |||
12 | import tools.refinery.store.query.dnf.AnyQuery; | 12 | import tools.refinery.store.query.dnf.AnyQuery; |
13 | 13 | ||
14 | public class QueryCriteria implements Criterion { | 14 | public class QueryCriteria implements Criterion { |
15 | protected final boolean acceptIfHasMatch; | 15 | protected final boolean satisfiedIfHasMatch; |
16 | protected final AnyQuery query; | 16 | protected final AnyQuery query; |
17 | 17 | ||
18 | /** | 18 | /** |
19 | * Criteria based on the existence of matches evaluated on the model. | 19 | * Criteria based on the existence of matches evaluated on the model. |
20 | * @param query The query evaluated on the model. | 20 | * @param query The query evaluated on the model. |
21 | * @param acceptIfHasMatch If true, the criteria satisfied if the query has any match on the model. Otherwise, | 21 | * @param satisfiedIfHasMatch If true, the criteria satisfied if the query has any match on the model. Otherwise, |
22 | * the criteria satisfied if the query has no match on the model. | 22 | * the criteria satisfied if the query has no match on the model. |
23 | */ | 23 | */ |
24 | public QueryCriteria(AnyQuery query, boolean acceptIfHasMatch) { | 24 | public QueryCriteria(AnyQuery query, boolean satisfiedIfHasMatch) { |
25 | this.query = query; | 25 | this.query = query; |
26 | this.acceptIfHasMatch = acceptIfHasMatch; | 26 | this.satisfiedIfHasMatch = satisfiedIfHasMatch; |
27 | } | 27 | } |
28 | 28 | ||
29 | @Override | 29 | @Override |
30 | public CriterionCalculator createCalculator(Model model) { | 30 | public CriterionCalculator createCalculator(Model model) { |
31 | var resultSet = model.getAdapter(ModelQueryAdapter.class).getResultSet(query); | 31 | var resultSet = model.getAdapter(ModelQueryAdapter.class).getResultSet(query); |
32 | if(acceptIfHasMatch) { | 32 | if(satisfiedIfHasMatch) { |
33 | return () -> resultSet.size() > 0; | 33 | return () -> resultSet.size() > 0; |
34 | } else { | 34 | } else { |
35 | return () -> resultSet.size() == 0; | 35 | return () -> resultSet.size() == 0; |
36 | } | 36 | } |
37 | } | 37 | } |
38 | 38 | ||