[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; |
---|
[1146] | 18 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; |
---|
| 19 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; |
---|
[1157] | 20 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskVisitor; |
---|
[439] | 21 | |
---|
| 22 | /** |
---|
| 23 | * TODO comment |
---|
| 24 | * |
---|
| 25 | * @version $Revision: $ $Date: 19.02.2012$ |
---|
| 26 | * @author 2012, last modified by $Author: patrick$ |
---|
| 27 | */ |
---|
[1146] | 28 | class Iteration extends MarkingTemporalRelationship implements IIteration { |
---|
[439] | 29 | |
---|
[1146] | 30 | /** */ |
---|
| 31 | private static final long serialVersionUID = 1L; |
---|
| 32 | |
---|
[557] | 33 | /** |
---|
| 34 | * |
---|
| 35 | */ |
---|
| 36 | Iteration() { |
---|
[1146] | 37 | super("iteration"); |
---|
[557] | 38 | } |
---|
[439] | 39 | |
---|
[1146] | 40 | /* (non-Javadoc) |
---|
| 41 | * @see MarkingTemporalRelationship#setMarkedTask(ITask) |
---|
[557] | 42 | */ |
---|
| 43 | @Override |
---|
[1146] | 44 | protected void setMarkedTask(ITask markedTask) { |
---|
| 45 | if (markedTask instanceof IIteration) { |
---|
| 46 | throw new IllegalArgumentException |
---|
| 47 | ("the marked task of an iteration must not be an iteration"); |
---|
[557] | 48 | } |
---|
[1146] | 49 | else if (markedTask instanceof IOptional) { |
---|
| 50 | throw new IllegalArgumentException |
---|
| 51 | ("the marked task of an iteration must not be an optional"); |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | super.setMarkedTask(markedTask); |
---|
[439] | 55 | } |
---|
| 56 | |
---|
[557] | 57 | /* |
---|
| 58 | * (non-Javadoc) |
---|
| 59 | * |
---|
| 60 | * @see java.lang.Object#clone() |
---|
| 61 | */ |
---|
| 62 | @Override |
---|
| 63 | public Iteration clone() { |
---|
| 64 | return (Iteration) super.clone(); |
---|
| 65 | } |
---|
[1157] | 66 | |
---|
| 67 | /* (non-Javadoc) |
---|
| 68 | * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeNode#accept(de.ugoe.cs.autoquest.tasktrees.treeifc.NodeVisitor) |
---|
| 69 | */ |
---|
| 70 | @Override |
---|
| 71 | public void accept(ITaskVisitor visitor) { |
---|
| 72 | visitor.visit(this); |
---|
| 73 | } |
---|
[439] | 74 | |
---|
| 75 | } |
---|