source: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/ITaskInstance.java

Last change on this file was 1405, checked in by pharms, 10 years ago
  • added visitor pattern for task instances
  • Property svn:executable set to *
File size: 2.3 KB
Line 
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
15package de.ugoe.cs.autoquest.tasktrees.treeifc;
16
17import java.io.Serializable;
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.
23 * </p>
24 *
25 * @author Patrick Harms
26 */
27public interface ITaskInstance extends Serializable, Cloneable {
28
29    /**
30     * <p>
31     * returns the task related to the instance.
32     * </p>
33     *
34     * @return as described
35     */
36    public ITask getTask();
37
38    /**
39     * <p>
40     * compares an instance to another one. Returns true if both instances are the same, i.e. not
41     * only the related task is equal but also all children and further characteristics of the
42     * task instance 
43     * </p>
44     *
45     * @param taskInstance the instance to compare to
46     *
47     * @return as described
48     */
49    public boolean equals(ITaskInstance taskInstance);
50
51    /**
52     * <p>
53     * returns a hash code for the task instance to be able to put it into hash maps
54     * </p>
55     *
56     * @return as described
57     */
58    public int hashCode();
59
60    /**
61     * <p>
62     * clones a task instance by creating exact clones of each contained child instance as well
63     * as the related task. Furthermore, all other non transient information of the task
64     * instance must be cloned.
65     * </p>
66     *
67     * @return a clone of the task instance
68     */
69    public ITaskInstance clone();
70
71    /**
72     * <p>
73     * implements the visitor pattern to be able to process task instances and their children.
74     * </p>
75     *
76     * @param visitor the visitor used to process the task
77     */
78    public void accept(ITaskInstanceVisitor visitor);
79   
80}
Note: See TracBrowser for help on using the repository browser.