source: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskComparisonRule.java @ 1612

Last change on this file since 1612 was 1294, checked in by pharms, 11 years ago
  • rework of task model to move event instance stuff to task instances
  • introduction of sequence, selection, iteration and optional instances
  • Property svn:executable set to *
File size: 4.9 KB
RevLine 
[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
[1146]15package de.ugoe.cs.autoquest.tasktrees.taskequality;
[439]16
[1146]17import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
[1294]18import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
[439]19
20/**
[557]21 * <p>
[1294]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.
[557]24 * </p>
[439]25 *
26 * @version $Revision: $ $Date: 19.02.2012$
27 * @author 2012, last modified by $Author: patrick$
28 */
[1146]29public interface TaskComparisonRule {
[439]30
[557]31    /**
32     * <p>
[1146]33     * checks if the rule is applicable for comparing the two provided tasks
[1125]34     * </p>
35     *
[1146]36     * @param task1 the first task to compare
37     * @param task2 the second task to compare
[1125]38     *
39     * @return true, if the rule is applicable, false else
40     */
[1146]41    public boolean isApplicable(ITask task1, ITask task2);
[1125]42
43    /**
44     * <p>
[1146]45     * checks, if the provided tasks are lexically equal
[1125]46     * </p>
47     *
[1146]48     * @param task1 the first task to compare
49     * @param task2 the second task to compare
[1125]50     *
[1146]51     * @return true, if the tasks are equal, false else
[1125]52     */
[1146]53    public boolean areLexicallyEqual(ITask task1, ITask task2);
[1125]54
55    /**
56     * <p>
[1146]57     * checks, if the provided tasks are syntactically equal
[1125]58     * </p>
59     *
[1146]60     * @param task1 the first task to compare
61     * @param task2 the second task to compare
[1125]62     *
[1146]63     * @return true, if the tasks are equal, false else
[1125]64     */
[1146]65    public boolean areSyntacticallyEqual(ITask task1, ITask task2);
[1125]66
67    /**
68     * <p>
[1146]69     * checks, if the provided tasks are semantically equal
[1125]70     * </p>
71     *
[1146]72     * @param task1 the first task to compare
73     * @param task2 the second task to compare
[1125]74     *
[1146]75     * @return true, if the tasks are equal, false else
[1125]76     */
[1146]77    public boolean areSemanticallyEqual(ITask task1, ITask task2);
[1125]78
79    /**
80     * <p>
[1146]81     * compares two tasks with each other. The result of the method is either a task equality or
[557]82     * null. If it is null, it means, that the rule is not able to correctly compare the two given
[1146]83     * tasks
[557]84     * </p>
85     *
[1146]86     * @param task1 the first task to compare
87     * @param task2 the second task to compare
[557]88     *
89     * @return as described
90     */
[1146]91    public TaskEquality compare(ITask task1, ITask task2);
[557]92
[1294]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
[439]155}
Note: See TracBrowser for help on using the repository browser.