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.taskequality; |
---|
16 | |
---|
17 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; |
---|
18 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; |
---|
19 | |
---|
20 | // TODO: Auto-generated Javadoc |
---|
21 | /** |
---|
22 | * <p> |
---|
23 | * A task comparison rule is used by the {@link TaskEqualityRuleManager} to |
---|
24 | * compare tasks and task instances with each other. It provides several methods |
---|
25 | * to be called for a comparison. |
---|
26 | * </p> |
---|
27 | * |
---|
28 | * @author 2012, last modified by $Author: patrick$ |
---|
29 | * @version $Revision: $ $Date: 19.02.2012$ |
---|
30 | */ |
---|
31 | public interface TaskComparisonRule { |
---|
32 | |
---|
33 | /** |
---|
34 | * <p> |
---|
35 | * checks, if the provided tasks are lexically equal |
---|
36 | * </p>. |
---|
37 | * |
---|
38 | * @param task1 the first task to compare |
---|
39 | * @param task2 the second task to compare |
---|
40 | * @return true, if the tasks are equal, false else |
---|
41 | */ |
---|
42 | public boolean areLexicallyEqual(ITask task1, ITask task2); |
---|
43 | |
---|
44 | /** |
---|
45 | * <p> |
---|
46 | * checks, if the provided task instances are lexically equal |
---|
47 | * </p>. |
---|
48 | * |
---|
49 | * @param instance1 the first task instance to compare |
---|
50 | * @param instance2 the second task instance to compare |
---|
51 | * @return true, if the tasks are equal, false else |
---|
52 | */ |
---|
53 | public boolean areLexicallyEqual(ITaskInstance instance1, |
---|
54 | ITaskInstance instance2); |
---|
55 | |
---|
56 | /** |
---|
57 | * <p> |
---|
58 | * checks, if the provided tasks are semantically equal |
---|
59 | * </p>. |
---|
60 | * |
---|
61 | * @param task1 the first task to compare |
---|
62 | * @param task2 the second task to compare |
---|
63 | * @return true, if the tasks are equal, false else |
---|
64 | */ |
---|
65 | public boolean areSemanticallyEqual(ITask task1, ITask task2); |
---|
66 | |
---|
67 | /** |
---|
68 | * <p> |
---|
69 | * checks, if the provided task instances are semantically equal |
---|
70 | * </p>. |
---|
71 | * |
---|
72 | * @param instance1 the first task instance to compare |
---|
73 | * @param instance2 the second task instance to compare |
---|
74 | * @return true, if the tasks are equal, false else |
---|
75 | */ |
---|
76 | public boolean areSemanticallyEqual(ITaskInstance instance1, |
---|
77 | ITaskInstance instance2); |
---|
78 | |
---|
79 | /** |
---|
80 | * <p> |
---|
81 | * checks, if the provided tasks are syntactically equal |
---|
82 | * </p>. |
---|
83 | * |
---|
84 | * @param task1 the first task to compare |
---|
85 | * @param task2 the second task to compare |
---|
86 | * @return true, if the tasks are equal, false else |
---|
87 | */ |
---|
88 | public boolean areSyntacticallyEqual(ITask task1, ITask task2); |
---|
89 | |
---|
90 | /** |
---|
91 | * <p> |
---|
92 | * checks, if the provided task instances are syntactically equal |
---|
93 | * </p>. |
---|
94 | * |
---|
95 | * @param instance1 the first task instance to compare |
---|
96 | * @param instance2 the second task instance to compare |
---|
97 | * @return true, if the tasks are equal, false else |
---|
98 | */ |
---|
99 | public boolean areSyntacticallyEqual(ITaskInstance instance1, |
---|
100 | ITaskInstance instance2); |
---|
101 | |
---|
102 | /** |
---|
103 | * <p> |
---|
104 | * compares two tasks with each other. The result of the method is either a |
---|
105 | * task equality or null. If it is null, it means, that the rule is not able |
---|
106 | * to correctly compare the two given tasks |
---|
107 | * </p> |
---|
108 | * |
---|
109 | * @param task1 |
---|
110 | * the first task to compare |
---|
111 | * @param task2 |
---|
112 | * the second task to compare |
---|
113 | * |
---|
114 | * @return as described |
---|
115 | */ |
---|
116 | public TaskEquality compare(ITask task1, ITask task2); |
---|
117 | |
---|
118 | /** |
---|
119 | * <p> |
---|
120 | * compares two task instances with each other. The result of the method is |
---|
121 | * either a task instance equality or null. If it is null, it means, that |
---|
122 | * the rule is not able to correctly compare the two given task instances |
---|
123 | * </p> |
---|
124 | * |
---|
125 | * @param instance1 |
---|
126 | * the first task instance to compare |
---|
127 | * @param instance2 |
---|
128 | * the second task instance to compare |
---|
129 | * |
---|
130 | * @return as described |
---|
131 | */ |
---|
132 | public TaskEquality compare(ITaskInstance instance1, ITaskInstance instance2); |
---|
133 | |
---|
134 | /** |
---|
135 | * <p> |
---|
136 | * checks if the rule is applicable for comparing the two provided tasks |
---|
137 | * </p>. |
---|
138 | * |
---|
139 | * @param task1 the first task to compare |
---|
140 | * @param task2 the second task to compare |
---|
141 | * @return true, if the rule is applicable, false else |
---|
142 | */ |
---|
143 | public boolean isApplicable(ITask task1, ITask task2); |
---|
144 | |
---|
145 | /** |
---|
146 | * <p> |
---|
147 | * checks if the rule is applicable for comparing the two provided task |
---|
148 | * instances |
---|
149 | * </p>. |
---|
150 | * |
---|
151 | * @param instance1 the first task instance to compare |
---|
152 | * @param instance2 the second task instance to compare |
---|
153 | * @return true, if the rule is applicable, false else |
---|
154 | */ |
---|
155 | public boolean isApplicable(ITaskInstance instance1, ITaskInstance instance2); |
---|
156 | |
---|
157 | } |
---|