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

Last change on this file since 1157 was 1157, checked in by adeicke, 11 years ago

Added Visitor pattern for tasks.

File size: 2.1 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;
19import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskVisitor;
20
21/**
22 * TODO comment
23 *
24 * @version $Revision: $ $Date: 19.02.2012$
25 * @author 2012, last modified by $Author: patrick$
26 */
27class Optional extends MarkingTemporalRelationship implements IOptional {
28
29    /**  */
30    private static final long serialVersionUID = 1L;
31
32    /**
33     *
34     */
35    Optional() {
36        super("optionality");
37    }
38   
39    /* (non-Javadoc)
40     * @see MarkingTemporalRelationship#setMarkedTask(ITask)
41     */
42    @Override
43    protected void setMarkedTask(ITask markedTask) {
44        if (markedTask instanceof IOptional) {
45            throw new IllegalArgumentException
46                ("the marked task of an optional must not be an optional");
47        }
48       
49        super.setMarkedTask(markedTask);
50    }
51
52    /*
53     * (non-Javadoc)
54     *
55     * @see java.lang.Object#clone()
56     */
57    @Override
58    public Optional clone() {
59        return (Optional) super.clone();
60    }
61
62    /* (non-Javadoc)
63     * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITemporalRelationship#accept(de.ugoe.cs.autoquest.tasktrees.treeifc.TaskVisitor)
64     */
65    @Override
66    public void accept(ITaskVisitor visitor) {
67        // TODO Auto-generated method stub
68        System.out.println("TODO: implement ITemporalRelationship.accept ");
69       
70    }
71}
Note: See TracBrowser for help on using the repository browser.