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