[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] | 15 | package de.ugoe.cs.autoquest.tasktrees.treeimpl; |
---|
[439] | 16 | |
---|
[922] | 17 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; |
---|
| 18 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; |
---|
[439] | 19 | |
---|
| 20 | /** |
---|
| 21 | * TODO comment |
---|
| 22 | * |
---|
| 23 | * @version $Revision: $ $Date: 19.02.2012$ |
---|
| 24 | * @author 2012, last modified by $Author: patrick$ |
---|
| 25 | */ |
---|
[557] | 26 | public class Iteration extends TaskTreeNode implements IIteration { |
---|
[439] | 27 | |
---|
[557] | 28 | /** |
---|
| 29 | * |
---|
| 30 | */ |
---|
| 31 | Iteration() { |
---|
| 32 | super("Iteration"); |
---|
| 33 | } |
---|
[439] | 34 | |
---|
[557] | 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 | } |
---|
[439] | 46 | |
---|
[557] | 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); |
---|
[439] | 58 | } |
---|
| 59 | |
---|
[557] | 60 | /* |
---|
| 61 | * (non-Javadoc) |
---|
| 62 | * |
---|
| 63 | * @see java.lang.Object#clone() |
---|
| 64 | */ |
---|
| 65 | @Override |
---|
| 66 | public Iteration clone() { |
---|
| 67 | return (Iteration) super.clone(); |
---|
| 68 | } |
---|
[439] | 69 | |
---|
| 70 | } |
---|