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.util.List; |
---|
18 |
|
---|
19 | /**
|
---|
20 | * <p> |
---|
21 | * a task instance represents the execution of a specific task within a user session. A task |
---|
22 | * instance is always related to the task that was executed. A task instance may have children |
---|
23 | * but only if its related task allows to have children. For example, if the represented task is |
---|
24 | * a sequence then task instance has children and these are instances of the tasks being the |
---|
25 | * children of the related sequence. |
---|
26 | * </p> |
---|
27 | * <p> |
---|
28 | * An instance of a sequence has the same number of children as the related sequence. An instance |
---|
29 | * of a selection has only one child which is an instance of exactly one variant contained in the |
---|
30 | * related selection. An instance of an iteration has zero or more instances of the same task |
---|
31 | * as children where the task is the child of the related iteration. An instance of an optional |
---|
32 | * has zero or one child where the task related to child is the child of the optional. A task |
---|
33 | * instance related to an event task does not have children. |
---|
34 | * </p>
|
---|
35 | * |
---|
36 | * @author Patrick Harms |
---|
37 | */
|
---|
38 | public interface ITaskInstance extends ITaskInstanceList {
|
---|
39 |
|
---|
40 | /** |
---|
41 | * <p> |
---|
42 | * returns the children of the task instance if any. See class description for how many |
---|
43 | * children can be expected. May return null. |
---|
44 | * </p> |
---|
45 | * |
---|
46 | * @return as described |
---|
47 | */ |
---|
48 | public List<ITaskInstance> getChildren(); |
---|
49 | |
---|
50 | /**
|
---|
51 | * <p> |
---|
52 | * returns the task related to the instance. |
---|
53 | * </p> |
---|
54 | * |
---|
55 | * @return as described
|
---|
56 | */
|
---|
57 | public ITask getTask();
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * <p> |
---|
61 | * compares an instance to another one. Returns true if both instances are the same, i.e. not |
---|
62 | * only the related task is equal but also all children and further characteristics of the |
---|
63 | * task instance |
---|
64 | * </p> |
---|
65 | * |
---|
66 | * @param taskInstance the instance to compare to |
---|
67 | * |
---|
68 | * @return as described
|
---|
69 | */
|
---|
70 | public boolean equals(ITaskInstance taskInstance);
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * <p> |
---|
74 | * returns a hash code for the task instance to be able to put it into hash maps |
---|
75 | * </p> |
---|
76 | * |
---|
77 | * @return as described
|
---|
78 | */
|
---|
79 | public int hashCode();
|
---|
80 | |
---|
81 | /** |
---|
82 | * <p> |
---|
83 | * clones a task instance by creating exact clones of each contained child instance as well |
---|
84 | * as the related task. Furthermore, all other non transient information of the task |
---|
85 | * instance must be cloned. |
---|
86 | * </p> |
---|
87 | * |
---|
88 | * @return a clone of the task instance |
---|
89 | */ |
---|
90 | public ITaskInstance clone(); |
---|
91 |
|
---|
92 | }
|
---|