[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; |
---|
[439] | 20 | |
---|
| 21 | /** |
---|
[1215] | 22 | * <p> |
---|
| 23 | * this is the default implementation of the interface {@link IIteration}. It does not do anything |
---|
| 24 | * fancy except implementing the interface. |
---|
| 25 | * </p> |
---|
| 26 | * |
---|
| 27 | * @author Patrick Harms |
---|
[439] | 28 | */ |
---|
[1146] | 29 | class Iteration extends MarkingTemporalRelationship implements IIteration { |
---|
[439] | 30 | |
---|
[1215] | 31 | /** |
---|
| 32 | * <p> |
---|
| 33 | * default serial version UID |
---|
| 34 | * </p> |
---|
| 35 | */ |
---|
[1146] | 36 | private static final long serialVersionUID = 1L; |
---|
| 37 | |
---|
[557] | 38 | /** |
---|
[1215] | 39 | * <p> |
---|
| 40 | * simple constructor providing the base class with a human readable name of the type of this |
---|
| 41 | * task |
---|
| 42 | * </p> |
---|
[557] | 43 | */ |
---|
| 44 | Iteration() { |
---|
[1146] | 45 | super("iteration"); |
---|
[557] | 46 | } |
---|
[439] | 47 | |
---|
[1146] | 48 | /* (non-Javadoc) |
---|
[1215] | 49 | * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.MarkingTemporalRelationship#setMarkedTask(ITask) |
---|
[557] | 50 | */ |
---|
| 51 | @Override |
---|
[1146] | 52 | protected void setMarkedTask(ITask markedTask) { |
---|
| 53 | if (markedTask instanceof IIteration) { |
---|
| 54 | throw new IllegalArgumentException |
---|
| 55 | ("the marked task of an iteration must not be an iteration"); |
---|
[557] | 56 | } |
---|
[1146] | 57 | else if (markedTask instanceof IOptional) { |
---|
| 58 | throw new IllegalArgumentException |
---|
| 59 | ("the marked task of an iteration must not be an optional"); |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | super.setMarkedTask(markedTask); |
---|
[439] | 63 | } |
---|
| 64 | |
---|
[1215] | 65 | /* (non-Javadoc) |
---|
| 66 | * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.MarkingTemporalRelationship#clone() |
---|
[557] | 67 | */ |
---|
| 68 | @Override |
---|
| 69 | public Iteration clone() { |
---|
| 70 | return (Iteration) super.clone(); |
---|
| 71 | } |
---|
[1157] | 72 | |
---|
[439] | 73 | } |
---|