[1146] | 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> |
---|
[1167] | 21 | * A task represents a model for events that occur if the user interacts with a software for |
---|
| 22 | * achieving a specific goal. A task can be a single event or a complex structure of events |
---|
| 23 | * and temporal relationships defining the event order. Tasks may especially refer to other tasks |
---|
| 24 | * to create task structures similar to trees. These structures fully define in which ways the |
---|
[1180] | 25 | * events that form the task can occur. However, the structure of a task is not necessarily a |
---|
| 26 | * tree as task structures may be reused several times in larger scale task structures. |
---|
[1146] | 27 | * </p> |
---|
| 28 | * |
---|
| 29 | * @author Patrick Harms |
---|
| 30 | */ |
---|
| 31 | public interface ITask extends Cloneable, Serializable { |
---|
| 32 | |
---|
| 33 | /** |
---|
[1167] | 34 | * <p> |
---|
| 35 | * every task is assigned a unique id which is returned by this method. The id is unique for |
---|
| 36 | * the current runtime. |
---|
| 37 | * </p> |
---|
| 38 | * |
---|
| 39 | * @return as described |
---|
[1146] | 40 | */ |
---|
| 41 | public int getId(); |
---|
| 42 | |
---|
| 43 | /** |
---|
[1167] | 44 | * <p> |
---|
| 45 | * returns a human readable description for task. |
---|
| 46 | * </p> |
---|
| 47 | * |
---|
| 48 | * @return as described |
---|
[1146] | 49 | */ |
---|
| 50 | public String getDescription(); |
---|
| 51 | |
---|
| 52 | /** |
---|
[1167] | 53 | * <p> |
---|
| 54 | * checks whether this task is equal to another one. Task equality is only given, if two |
---|
| 55 | * tasks have the same id. This means, that this method must only return true if the other |
---|
| 56 | * task is either the same object or a clone of it. |
---|
| 57 | * </p> |
---|
| 58 | * |
---|
| 59 | * @return as described |
---|
[1146] | 60 | */ |
---|
| 61 | public boolean equals(ITask task); |
---|
| 62 | |
---|
| 63 | /** |
---|
[1167] | 64 | * <p> |
---|
| 65 | * returns a hash code for the task, which is usually the id returned by {@link #getId()}. |
---|
| 66 | * </p> |
---|
| 67 | * |
---|
| 68 | * @return as described |
---|
[1146] | 69 | */ |
---|
| 70 | public int hashCode(); |
---|
| 71 | |
---|
| 72 | /** |
---|
[1167] | 73 | * <p> |
---|
| 74 | * returns an exact copy of this task. The clone has the same id. If the task has |
---|
| 75 | * children, they are cloned as well. A call on the method {@link #equals(ITask)} with the |
---|
| 76 | * result of this method must return true. |
---|
| 77 | * </p> |
---|
| 78 | * |
---|
| 79 | * @return as described |
---|
[1146] | 80 | */ |
---|
| 81 | public ITask clone(); |
---|
[1157] | 82 | |
---|
| 83 | /** |
---|
[1167] | 84 | * <p> |
---|
| 85 | * implements the visitor pattern to be able to process tasks and their children. |
---|
| 86 | * </p> |
---|
| 87 | * |
---|
| 88 | * @param visitor the visitor used to process the task |
---|
[1157] | 89 | */ |
---|
[1167] | 90 | public void accept(ITaskVisitor visitor); |
---|
[1157] | 91 | |
---|
[1146] | 92 | } |
---|