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 | |
---|
15 | package de.ugoe.cs.autoquest.tasktrees.treeimpl; |
---|
16 | |
---|
17 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; |
---|
18 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; |
---|
19 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; |
---|
20 | |
---|
21 | /** |
---|
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 |
---|
28 | */ |
---|
29 | class Iteration extends MarkingTemporalRelationship implements IIteration { |
---|
30 | |
---|
31 | /** |
---|
32 | * <p> |
---|
33 | * default serial version UID |
---|
34 | * </p> |
---|
35 | */ |
---|
36 | private static final long serialVersionUID = 1L; |
---|
37 | |
---|
38 | /** |
---|
39 | * <p> |
---|
40 | * simple constructor providing the base class with a human readable name of the type of this |
---|
41 | * task |
---|
42 | * </p> |
---|
43 | */ |
---|
44 | Iteration() { |
---|
45 | super("iteration"); |
---|
46 | } |
---|
47 | |
---|
48 | /* (non-Javadoc) |
---|
49 | * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.MarkingTemporalRelationship#setMarkedTask(ITask) |
---|
50 | */ |
---|
51 | @Override |
---|
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"); |
---|
56 | } |
---|
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); |
---|
63 | } |
---|
64 | |
---|
65 | /* (non-Javadoc) |
---|
66 | * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.MarkingTemporalRelationship#clone() |
---|
67 | */ |
---|
68 | @Override |
---|
69 | public Iteration clone() { |
---|
70 | return (Iteration) super.clone(); |
---|
71 | } |
---|
72 | |
---|
73 | } |
---|