1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany |
---|
2 | // |
---|
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
---|
4 | // you may not use this file except in compliance with the License. |
---|
5 | // You may obtain a copy of the License at |
---|
6 | // |
---|
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
---|
8 | // |
---|
9 | // Unless required by applicable law or agreed to in writing, software |
---|
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
---|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
12 | // See the License for the specific language governing permissions and |
---|
13 | // limitations under the License. |
---|
14 | |
---|
15 | package de.ugoe.cs.autoquest.tasktrees.temporalrelation; |
---|
16 | |
---|
17 | import java.util.ArrayList; |
---|
18 | import java.util.List; |
---|
19 | |
---|
20 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; |
---|
21 | |
---|
22 | /** |
---|
23 | * <p> |
---|
24 | * The rule application result describes the result of applying a {@link TemporalRelationshipRule} |
---|
25 | * on a task tree node. It contains a {@link RuleApplicationStatus} and a list of all parent |
---|
26 | * task tree nodes that were created during a rule application. See the description of |
---|
27 | * {@link TemporalRelationshipRule} for more details. |
---|
28 | * </p> |
---|
29 | * |
---|
30 | * @author Patrick Harms |
---|
31 | */ |
---|
32 | class RuleApplicationResult { |
---|
33 | |
---|
34 | /** */ |
---|
35 | private RuleApplicationStatus status = RuleApplicationStatus.RULE_NOT_APPLIED; |
---|
36 | |
---|
37 | /** */ |
---|
38 | private List<ITaskTreeNode> newParents = new ArrayList<ITaskTreeNode>(); |
---|
39 | |
---|
40 | /** |
---|
41 | * <p> |
---|
42 | * create a rule application result with a status {@link RuleApplicationStatus#RULE_NOT_APPLIED} |
---|
43 | * </p> |
---|
44 | */ |
---|
45 | RuleApplicationResult() { |
---|
46 | // this is the default indicating nothing so far |
---|
47 | } |
---|
48 | |
---|
49 | /** |
---|
50 | * <p> |
---|
51 | * set the rule application status |
---|
52 | * </p> |
---|
53 | */ |
---|
54 | void setRuleApplicationStatus(RuleApplicationStatus status) { |
---|
55 | this.status = status; |
---|
56 | } |
---|
57 | |
---|
58 | /** |
---|
59 | * <p> |
---|
60 | * return the rule application status |
---|
61 | * </p> |
---|
62 | */ |
---|
63 | RuleApplicationStatus getRuleApplicationStatus() { |
---|
64 | return status; |
---|
65 | } |
---|
66 | |
---|
67 | /** |
---|
68 | * <p> |
---|
69 | * add a further parent node created during the rule application |
---|
70 | * </p> |
---|
71 | */ |
---|
72 | void addNewlyCreatedParentNode(ITaskTreeNode newParent) { |
---|
73 | newParents.add(newParent); |
---|
74 | } |
---|
75 | |
---|
76 | /** |
---|
77 | * <p> |
---|
78 | * return all parent nodes created during the rule application |
---|
79 | * </p> |
---|
80 | */ |
---|
81 | List<ITaskTreeNode> getNewlyCreatedParentNodes() { |
---|
82 | return newParents; |
---|
83 | } |
---|
84 | |
---|
85 | } |
---|