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.treeifc; |
---|
16 | |
---|
17 | import java.io.Serializable; |
---|
18 | |
---|
19 | /** |
---|
20 | * <p> |
---|
21 | * a task instance represents the execution of a specific task within a user |
---|
22 | * session. A task instance is always related to the task that was executed. |
---|
23 | * </p> |
---|
24 | * |
---|
25 | * @author Patrick Harms |
---|
26 | */ |
---|
27 | public interface ITaskInstance extends Serializable, Cloneable { |
---|
28 | |
---|
29 | /** |
---|
30 | * <p> |
---|
31 | * implements the visitor pattern to be able to process task instances and |
---|
32 | * their children. |
---|
33 | * </p> |
---|
34 | * |
---|
35 | * @param visitor |
---|
36 | * the visitor used to process the task |
---|
37 | */ |
---|
38 | public void accept(ITaskInstanceVisitor visitor); |
---|
39 | |
---|
40 | /** |
---|
41 | * <p> |
---|
42 | * clones a task instance by creating exact clones of each contained child |
---|
43 | * instance as well as the related task. Furthermore, all other non |
---|
44 | * transient information of the task instance must be cloned. |
---|
45 | * </p> |
---|
46 | * |
---|
47 | * @return a clone of the task instance |
---|
48 | */ |
---|
49 | public ITaskInstance clone(); |
---|
50 | |
---|
51 | /** |
---|
52 | * <p> |
---|
53 | * compares an instance to another one. Returns true if both instances are |
---|
54 | * the same, i.e. not only the related task is equal but also all children |
---|
55 | * and further characteristics of the task instance |
---|
56 | * </p> |
---|
57 | * |
---|
58 | * @param taskInstance |
---|
59 | * the instance to compare to |
---|
60 | * |
---|
61 | * @return as described |
---|
62 | */ |
---|
63 | public boolean equals(ITaskInstance taskInstance); |
---|
64 | |
---|
65 | /** |
---|
66 | * <p> |
---|
67 | * returns the task related to the instance. |
---|
68 | * </p> |
---|
69 | * |
---|
70 | * @return as described |
---|
71 | */ |
---|
72 | public ITask getTask(); |
---|
73 | |
---|
74 | /** |
---|
75 | * <p> |
---|
76 | * returns a hash code for the task instance to be able to put it into hash |
---|
77 | * maps |
---|
78 | * </p> |
---|
79 | * |
---|
80 | * @return as described |
---|
81 | */ |
---|
82 | @Override |
---|
83 | public int hashCode(); |
---|
84 | |
---|
85 | } |
---|