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