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