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

Last change on this file since 1764 was 1764, checked in by pharms, 10 years ago
  • improved model checking
  • Property svn:executable set to *
File size: 2.2 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.ISelection;
18import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
19
20/**
21 * <p>
22 * this is the default implementation of the interface {@link ISelection}. It does not do anything
23 * fancy except implementing the interface.
24 * </p>
25 *
26 * @author Patrick Harms
27 */
28class Selection extends StructuringTemporalRelationship implements ISelection {
29
30    /**
31     * <p>
32     * default serial version UID
33     * </p>
34     */
35    private static final long serialVersionUID = 1L;
36
37    /**
38     * <p>
39     * simple constructor providing the base class with a human readable name of the type of this
40     * task
41     * </p>
42     */
43    Selection() {
44        super("selection");
45    }
46
47    /* (non-Javadoc)
48     * @see StructuringTemporalRelationship#clone()
49     */
50    @Override
51    public Selection clone() {
52        return (Selection) super.clone();
53    }
54
55    /* (non-Javadoc)
56     * @see StructuringTemporalRelationship#addChild(ITask)
57     */
58    @Override
59    void addChild(ITask newChild) {
60        if (newChild instanceof ISelection) {
61            throw new IllegalArgumentException("the child of a selection must not be a selection");
62        }
63       
64        super.addChild(newChild);
65    }
66
67    /* (non-Javadoc)
68     * @see StructuringTemporalRelationship#addChild(int,ITask)
69     */
70    @Override
71    void addChild(int index, ITask newChild) {
72        if (newChild instanceof ISelection) {
73            throw new IllegalArgumentException("the child of a selection must not be a selection");
74        }
75
76        super.addChild(index, newChild);
77    }
78
79}
Note: See TracBrowser for help on using the repository browser.