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.nodeequality; |
---|
16 | |
---|
17 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; |
---|
18 | |
---|
19 | /** |
---|
20 | * <p> |
---|
21 | * A node comparison rule is used by the {@link NodeEqualityRuleManager} to compare task tree |
---|
22 | * nodes with each other. It provides one method to be called for a comparison. |
---|
23 | * </p> |
---|
24 | * |
---|
25 | * @version $Revision: $ $Date: 19.02.2012$ |
---|
26 | * @author 2012, last modified by $Author: patrick$ |
---|
27 | */ |
---|
28 | public interface NodeComparisonRule { |
---|
29 | |
---|
30 | /** |
---|
31 | * <p> |
---|
32 | * checks if the rule is applicable for comparing the two provided nodes |
---|
33 | * </p> |
---|
34 | * |
---|
35 | * @param node1 the first task tree node to compare |
---|
36 | * @param node2 the second task tree node to compare |
---|
37 | * |
---|
38 | * @return true, if the rule is applicable, false else |
---|
39 | */ |
---|
40 | public boolean isApplicable(ITaskTreeNode node1, ITaskTreeNode node2); |
---|
41 | |
---|
42 | /** |
---|
43 | * <p> |
---|
44 | * checks, if the provided nodes are lexically equal |
---|
45 | * </p> |
---|
46 | * |
---|
47 | * @param node1 the first task tree node to compare |
---|
48 | * @param node2 the second task tree node to compare |
---|
49 | * |
---|
50 | * @return true, if the nodes are equal, false else |
---|
51 | */ |
---|
52 | public boolean areLexicallyEqual(ITaskTreeNode node1, ITaskTreeNode node2); |
---|
53 | |
---|
54 | /** |
---|
55 | * <p> |
---|
56 | * checks, if the provided nodes are syntactically equal |
---|
57 | * </p> |
---|
58 | * |
---|
59 | * @param node1 the first task tree node to compare |
---|
60 | * @param node2 the second task tree node to compare |
---|
61 | * |
---|
62 | * @return true, if the nodes are equal, false else |
---|
63 | */ |
---|
64 | public boolean areSyntacticallyEqual(ITaskTreeNode node1, ITaskTreeNode node2); |
---|
65 | |
---|
66 | /** |
---|
67 | * <p> |
---|
68 | * checks, if the provided nodes are semantically equal |
---|
69 | * </p> |
---|
70 | * |
---|
71 | * @param node1 the first task tree node to compare |
---|
72 | * @param node2 the second task tree node to compare |
---|
73 | * |
---|
74 | * @return true, if the nodes are equal, false else |
---|
75 | */ |
---|
76 | public boolean areSemanticallyEqual(ITaskTreeNode node1, ITaskTreeNode node2); |
---|
77 | |
---|
78 | /** |
---|
79 | * <p> |
---|
80 | * compares two nodes with each other. The result of the method is either a node equality or |
---|
81 | * null. If it is null, it means, that the rule is not able to correctly compare the two given |
---|
82 | * nodes |
---|
83 | * </p> |
---|
84 | * |
---|
85 | * @param node1 the first task tree node to compare |
---|
86 | * @param node2 the second task tree node to compare |
---|
87 | * |
---|
88 | * @return as described |
---|
89 | */ |
---|
90 | public NodeEquality compare(ITaskTreeNode node1, ITaskTreeNode node2); |
---|
91 | |
---|
92 | } |
---|