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

Last change on this file since 1113 was 1113, checked in by pharms, 11 years ago
  • added license statement
  • Property svn:executable set to *
File size: 1.8 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.IIteration;
18import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode;
19
20/**
21 * TODO comment
22 *
23 * @version $Revision: $ $Date: 19.02.2012$
24 * @author 2012, last modified by $Author: patrick$
25 */
26public class Iteration extends TaskTreeNode implements IIteration {
27
28    /**
29     *
30     */
31    Iteration() {
32        super("Iteration");
33    }
34
35    /*
36     * (non-Javadoc)
37     *
38     * @see de.ugoe.cs.tasktree.treeifc.TaskTreeNode#addChild(TaskTreeNode)
39     */
40    @Override
41    public void addChild(ITaskTreeNode child) {
42        // adding more children is not allowed
43        throw new UnsupportedOperationException
44          ("iterations may not have a list of children. Use setChild() instead.");
45    }
46
47    /**
48     * TODO: comment
49     *
50     * @param selection
51     * @return
52     */
53    public void setChild(ITaskTreeNode child) {
54        if (super.getChildren().size() > 0) {
55            super.removeChild(0);
56        }
57        super.addChild(child);
58    }
59
60    /*
61     * (non-Javadoc)
62     *
63     * @see java.lang.Object#clone()
64     */
65    @Override
66    public Iteration clone() {
67        return (Iteration) super.clone();
68    }
69
70}
Note: See TracBrowser for help on using the repository browser.