[1113] | 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 | |
---|
[922] | 15 | package de.ugoe.cs.autoquest.tasktrees.temporalrelation; |
---|
[439] | 16 | |
---|
| 17 | import java.util.ArrayList; |
---|
| 18 | import java.util.List; |
---|
| 19 | |
---|
[922] | 20 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; |
---|
[439] | 21 | |
---|
| 22 | /** |
---|
[809] | 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> |
---|
[439] | 29 | * |
---|
[809] | 30 | * @author Patrick Harms |
---|
[439] | 31 | */ |
---|
[809] | 32 | class RuleApplicationResult { |
---|
[439] | 33 | |
---|
[557] | 34 | /** */ |
---|
| 35 | private RuleApplicationStatus status = RuleApplicationStatus.RULE_NOT_APPLIED; |
---|
[439] | 36 | |
---|
[557] | 37 | /** */ |
---|
| 38 | private List<ITaskTreeNode> newParents = new ArrayList<ITaskTreeNode>(); |
---|
[439] | 39 | |
---|
[557] | 40 | /** |
---|
[809] | 41 | * <p> |
---|
| 42 | * create a rule application result with a status {@link RuleApplicationStatus#RULE_NOT_APPLIED} |
---|
| 43 | * </p> |
---|
[557] | 44 | */ |
---|
[809] | 45 | RuleApplicationResult() { |
---|
[557] | 46 | // this is the default indicating nothing so far |
---|
| 47 | } |
---|
[439] | 48 | |
---|
[557] | 49 | /** |
---|
[809] | 50 | * <p> |
---|
| 51 | * set the rule application status |
---|
| 52 | * </p> |
---|
[557] | 53 | */ |
---|
[809] | 54 | void setRuleApplicationStatus(RuleApplicationStatus status) { |
---|
[557] | 55 | this.status = status; |
---|
| 56 | } |
---|
[439] | 57 | |
---|
[557] | 58 | /** |
---|
[809] | 59 | * <p> |
---|
| 60 | * return the rule application status |
---|
| 61 | * </p> |
---|
[557] | 62 | */ |
---|
[809] | 63 | RuleApplicationStatus getRuleApplicationStatus() { |
---|
[557] | 64 | return status; |
---|
| 65 | } |
---|
[439] | 66 | |
---|
[557] | 67 | /** |
---|
[809] | 68 | * <p> |
---|
| 69 | * add a further parent node created during the rule application |
---|
| 70 | * </p> |
---|
[557] | 71 | */ |
---|
[809] | 72 | void addNewlyCreatedParentNode(ITaskTreeNode newParent) { |
---|
[557] | 73 | newParents.add(newParent); |
---|
| 74 | } |
---|
[439] | 75 | |
---|
[557] | 76 | /** |
---|
[809] | 77 | * <p> |
---|
| 78 | * return all parent nodes created during the rule application |
---|
| 79 | * </p> |
---|
[557] | 80 | */ |
---|
[809] | 81 | List<ITaskTreeNode> getNewlyCreatedParentNodes() { |
---|
[557] | 82 | return newParents; |
---|
| 83 | } |
---|
| 84 | |
---|
[439] | 85 | } |
---|