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

Last change on this file since 1197 was 1197, checked in by pharms, 11 years ago
  • improved java doc
  • Property svn:executable set to *
File size: 7.1 KB
RevLine 
[1113]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
[922]15package de.ugoe.cs.autoquest.tasktrees.treeifc;
[439]16
17/**
[1191]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>
[439]23 */
[1146]24public interface ITaskBuilder {
[439]25
[557]26    /**
[1191]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
[1146]36     */
37    void addChild(ITaskInstance taskInstance, ITaskInstance child) throws IllegalArgumentException;
38
39    /**
40     * <p>
[1191]41     * adds a task instance to a user session
[1146]42     * </p>
[1114]43     *
[1191]44     * @param session      the session to add the task instance to
45     * @param taskInstance the task instance to add
[557]46     */
[1146]47    void addExecutedTask(IUserSession session, ITaskInstance taskInstance);
[439]48
[557]49    /**
[1191]50     * <p>
51     * adds a task instance to a task instance list
52     * </p>
[1146]53     *
[1191]54     * @param taskInstanceList the list to add the task instance to
55     * @param taskInstance     the task instance to add
[1146]56     */
57    void addTaskInstance(ITaskInstanceList taskInstanceList, ITaskInstance taskInstance);
58
59    /**
[1191]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>
[1146]64     *
[1191]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
[1146]70     */
[1191]71    void addTaskInstance(ITaskInstanceList taskInstanceList, int index, ITaskInstance taskInstance)
72        throws IndexOutOfBoundsException;
[1146]73
74    /**
[1191]75     * <p>
76     * sets a task instance in a task instance list at a specific position
77     * </p>
[1146]78     *
[1191]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
[1146]84     */
[1191]85    void setTaskInstance(ITaskInstanceList taskInstanceList, int index, ITaskInstance taskInstance)
86        throws IndexOutOfBoundsException;
[1146]87
88    /**
89     * <p>
[1191]90     * sets the task model of a task instance
[1146]91     * </p>
[1191]92     *
93     * @param taskInstance the task instance to set the task model for
94     * @param task         the task model of the instance
[557]95     */
[1146]96    void setTask(ITaskInstance taskInstance, ITask task);
[439]97
[557]98    /**
[1191]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
[1146]105     */
106    void addChild(ISequence parent, ITask child);
107
108    /**
[1191]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
[1146]118     */
[1191]119    void addChild(ISequence parent, int index, ITask child)
120        throws IndexOutOfBoundsException;
[1146]121
122    /**
[1191]123     * <p>
124     * replaces the child task of a sequence at a specific position
125     * </p>
[1126]126     *
[1191]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
[1126]132     */
[1191]133    void setChild(ISequence parent, int index, ITask child)
134        throws IndexOutOfBoundsException;
[1126]135
136    /**
[1191]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
[557]143     */
[1146]144    void addChild(ISelection parent, ITask child);
[439]145
[557]146    /**
[1191]147     * <p>
148     * sets the child task of an iteration
149     * </p>
[557]150     *
[1197]151     * @param iteration the iteration to set the child of
152     * @param child     the child to be set
[557]153     */
[1191]154    void setMarkedTask(IIteration iteration, ITask child);
[439]155
[557]156    /**
[1191]157     * <p>
158     * sets the child task of an optional
159     * </p>
[557]160     *
[1197]161     * @param optional the optional to set the child of
162     * @param child    the child to be set
[1126]163     */
[1191]164    void setMarkedTask(IOptional optional, ITask child);
[1126]165
166    /**
[1191]167     * <p>
168     * removes the child of a sequence at a specific position
169     * </p>
[1126]170     *
[1191]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
[557]175     */
[1191]176    void removeChild(ISequence parent, int index)
177        throws IndexOutOfBoundsException;
[439]178
[557]179    /**
[1191]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
[557]187     */
[1146]188    void removeChild(ISelection parent, ITask child);
[439]189
[557]190    /**
[1191]191     * <p>
192     * removes the entry of a task instance list at a specific position
193     * </p>
[1146]194     *
[1191]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
[1146]199     */
[1191]200    void removeTaskInstance(ITaskInstanceList taskInstanceList, int index)
201        throws IndexOutOfBoundsException;
[1146]202
203    /**
[1191]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
[1126]214     */
[1146]215    void replaceChild(ISelection parent, ITask oldChild, ITask newChild);
[1126]216
217    /**
[1191]218     * <p>
219     * sets the description of a task
220     * </p>
[557]221     *
[1191]222     * @param task        the task to set the description of
223     * @param description the new description of the task
[557]224     */
[1146]225    void setDescription(ITask task, String description);
[439]226
227}
Note: See TracBrowser for help on using the repository browser.