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 | /** |
---|
18 | * <p> |
---|
19 | * Builder for task models. Can be used to create and edit task models. May perform integrity |
---|
20 | * checks, though they may be incomplete as the integrity of a task model can not be ensured during |
---|
21 | * creation. |
---|
22 | * </p> |
---|
23 | */ |
---|
24 | public interface ITaskBuilder { |
---|
25 | |
---|
26 | /** |
---|
27 | * <p> |
---|
28 | * adds a child to a task instance. May ensure, that the child is a valid child considering |
---|
29 | * the task model of the parent. In that case, an IllegalArgumentException is thrown. |
---|
30 | * </p> |
---|
31 | * |
---|
32 | * @param taskInstance the instance of add the child to |
---|
33 | * @param child the child to be added |
---|
34 | * |
---|
35 | * @throws IllegalArgumentException as described |
---|
36 | */ |
---|
37 | void addChild(ITaskInstance taskInstance, ITaskInstance child) throws IllegalArgumentException; |
---|
38 | |
---|
39 | /** |
---|
40 | * <p> |
---|
41 | * adds a task instance to a user session |
---|
42 | * </p> |
---|
43 | * |
---|
44 | * @param session the session to add the task instance to |
---|
45 | * @param taskInstance the task instance to add |
---|
46 | */ |
---|
47 | void addExecutedTask(IUserSession session, ITaskInstance taskInstance); |
---|
48 | |
---|
49 | /** |
---|
50 | * <p> |
---|
51 | * adds a task instance to a task instance list |
---|
52 | * </p> |
---|
53 | * |
---|
54 | * @param taskInstanceList the list to add the task instance to |
---|
55 | * @param taskInstance the task instance to add |
---|
56 | */ |
---|
57 | void addTaskInstance(ITaskInstanceList taskInstanceList, ITaskInstance taskInstance); |
---|
58 | |
---|
59 | /** |
---|
60 | * <p> |
---|
61 | * adds a task instance to a task instance list at a specific position. Subsequent task |
---|
62 | * instances will be moved one index forward |
---|
63 | * </p> |
---|
64 | * |
---|
65 | * @param taskInstanceList the list to add the task instance to |
---|
66 | * @param index the index of the task instance to add |
---|
67 | * @param taskInstance the task instance to add |
---|
68 | * |
---|
69 | * @throws IndexOutOfBoundsException if the index is invalid |
---|
70 | */ |
---|
71 | void addTaskInstance(ITaskInstanceList taskInstanceList, int index, ITaskInstance taskInstance) |
---|
72 | throws IndexOutOfBoundsException; |
---|
73 | |
---|
74 | /** |
---|
75 | * <p> |
---|
76 | * sets a task instance in a task instance list at a specific position |
---|
77 | * </p> |
---|
78 | * |
---|
79 | * @param taskInstanceList the list to set the task instance in |
---|
80 | * @param index the index of the task instance to replace |
---|
81 | * @param taskInstance the replacement for the task instance at the index |
---|
82 | * |
---|
83 | * @throws IndexOutOfBoundsException if the index is invalid |
---|
84 | */ |
---|
85 | void setTaskInstance(ITaskInstanceList taskInstanceList, int index, ITaskInstance taskInstance) |
---|
86 | throws IndexOutOfBoundsException; |
---|
87 | |
---|
88 | /** |
---|
89 | * <p> |
---|
90 | * sets the task model of a task instance |
---|
91 | * </p> |
---|
92 | * |
---|
93 | * @param taskInstance the task instance to set the task model for |
---|
94 | * @param task the task model of the instance |
---|
95 | */ |
---|
96 | void setTask(ITaskInstance taskInstance, ITask task); |
---|
97 | |
---|
98 | /** |
---|
99 | * <p> |
---|
100 | * adds a child task to the end of a sequence |
---|
101 | * </p> |
---|
102 | * |
---|
103 | * @param parent the sequence to add the child to |
---|
104 | * @param child the child to be added |
---|
105 | */ |
---|
106 | void addChild(ISequence parent, ITask child); |
---|
107 | |
---|
108 | /** |
---|
109 | * <p> |
---|
110 | * adds a child task to a specific index of a sequence |
---|
111 | * </p> |
---|
112 | * |
---|
113 | * @param parent the sequence to add the child to |
---|
114 | * @param index the index to set the child at |
---|
115 | * @param child the child to be added |
---|
116 | * |
---|
117 | * @throws IndexOutOfBoundsException if the index is invalid |
---|
118 | */ |
---|
119 | void addChild(ISequence parent, int index, ITask child) |
---|
120 | throws IndexOutOfBoundsException; |
---|
121 | |
---|
122 | /** |
---|
123 | * <p> |
---|
124 | * replaces the child task of a sequence at a specific position |
---|
125 | * </p> |
---|
126 | * |
---|
127 | * @param parent the sequence to replace the child in |
---|
128 | * @param index the index to replace the child at |
---|
129 | * @param child the child to be added |
---|
130 | * |
---|
131 | * @throws IndexOutOfBoundsException if the index is invalid |
---|
132 | */ |
---|
133 | void setChild(ISequence parent, int index, ITask child) |
---|
134 | throws IndexOutOfBoundsException; |
---|
135 | |
---|
136 | /** |
---|
137 | * <p> |
---|
138 | * adds a child task to a selection |
---|
139 | * </p> |
---|
140 | * |
---|
141 | * @param parent the selection to add the child to |
---|
142 | * @param child the child to be added |
---|
143 | */ |
---|
144 | void addChild(ISelection parent, ITask child); |
---|
145 | |
---|
146 | /** |
---|
147 | * <p> |
---|
148 | * sets the child task of an iteration |
---|
149 | * </p> |
---|
150 | * |
---|
151 | * @param iteration the iteration to set the child of |
---|
152 | * @param child the child to be set |
---|
153 | */ |
---|
154 | void setMarkedTask(IIteration iteration, ITask child); |
---|
155 | |
---|
156 | /** |
---|
157 | * <p> |
---|
158 | * sets the child task of an optional |
---|
159 | * </p> |
---|
160 | * |
---|
161 | * @param optional the optional to set the child of |
---|
162 | * @param child the child to be set |
---|
163 | */ |
---|
164 | void setMarkedTask(IOptional optional, ITask child); |
---|
165 | |
---|
166 | /** |
---|
167 | * <p> |
---|
168 | * removes the child of a sequence at a specific position |
---|
169 | * </p> |
---|
170 | * |
---|
171 | * @param parent the sequence of which the child must be removed |
---|
172 | * @param index the index of the child to be removed |
---|
173 | * |
---|
174 | * @throws IndexOutOfBoundsException if the index is invalid |
---|
175 | */ |
---|
176 | void removeChild(ISequence parent, int index) |
---|
177 | throws IndexOutOfBoundsException; |
---|
178 | |
---|
179 | /** |
---|
180 | * <p> |
---|
181 | * removes a child of a selection. Ignores the call, if the child is not found |
---|
182 | * (comparison using equals). |
---|
183 | * </p> |
---|
184 | * |
---|
185 | * @param parent the selection of which the child must be removed |
---|
186 | * @param child the child to be removes |
---|
187 | */ |
---|
188 | void removeChild(ISelection parent, ITask child); |
---|
189 | |
---|
190 | /** |
---|
191 | * <p> |
---|
192 | * removes the entry of a task instance list at a specific position |
---|
193 | * </p> |
---|
194 | * |
---|
195 | * @param taskInstanceList the task instance list of which the entry must be removed |
---|
196 | * @param index the index of the entry to be removed |
---|
197 | * |
---|
198 | * @throws IndexOutOfBoundsException if the index is invalid |
---|
199 | */ |
---|
200 | void removeTaskInstance(ITaskInstanceList taskInstanceList, int index) |
---|
201 | throws IndexOutOfBoundsException; |
---|
202 | |
---|
203 | /** |
---|
204 | * <p> |
---|
205 | * replaces a child of a selection. Throws an IllegalArgumentException if the child is not |
---|
206 | * found (comparison using equals). |
---|
207 | * </p> |
---|
208 | * |
---|
209 | * @param parent the selection of which the child must be replace |
---|
210 | * @param oldChild the child to replace |
---|
211 | * @param newChild the replacement for the child |
---|
212 | * |
---|
213 | * @throws as described |
---|
214 | */ |
---|
215 | void replaceChild(ISelection parent, ITask oldChild, ITask newChild); |
---|
216 | |
---|
217 | /** |
---|
218 | * <p> |
---|
219 | * sets the description of a task |
---|
220 | * </p> |
---|
221 | * |
---|
222 | * @param task the task to set the description of |
---|
223 | * @param description the new description of the task |
---|
224 | */ |
---|
225 | void setDescription(ITask task, String description); |
---|
226 | |
---|
227 | } |
---|