source: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/Optional.java @ 1155

Last change on this file since 1155 was 1146, checked in by pharms, 11 years ago
  • complete refactoring of task tree model with a separation of task models and task instances
  • appropriate adaptation of task tree generation process
  • appropriate adaptation of commands and task tree visualization
File size: 1.7 KB
Line 
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
15package de.ugoe.cs.autoquest.tasktrees.treeimpl;
16
17import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional;
18import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
19
20/**
21 * TODO comment
22 *
23 * @version $Revision: $ $Date: 19.02.2012$
24 * @author 2012, last modified by $Author: patrick$
25 */
26class Optional extends MarkingTemporalRelationship implements IOptional {
27
28    /**  */
29    private static final long serialVersionUID = 1L;
30
31    /**
32     *
33     */
34    Optional() {
35        super("optionality");
36    }
37   
38    /* (non-Javadoc)
39     * @see MarkingTemporalRelationship#setMarkedTask(ITask)
40     */
41    @Override
42    protected void setMarkedTask(ITask markedTask) {
43        if (markedTask instanceof IOptional) {
44            throw new IllegalArgumentException
45                ("the marked task of an optional must not be an optional");
46        }
47       
48        super.setMarkedTask(markedTask);
49    }
50
51    /*
52     * (non-Javadoc)
53     *
54     * @see java.lang.Object#clone()
55     */
56    @Override
57    public Optional clone() {
58        return (Optional) super.clone();
59    }
60}
Note: See TracBrowser for help on using the repository browser.