Changeset 1146 for trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/Iteration.java
- Timestamp:
- 04/04/13 16:06:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/Iteration.java
r1126 r1146 16 16 17 17 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 19 20 20 21 /** … … 24 25 * @author 2012, last modified by $Author: patrick$ 25 26 */ 26 public class Iteration extends TaskTreeNode implements IIteration { 27 class Iteration extends MarkingTemporalRelationship implements IIteration { 28 29 /** */ 30 private static final long serialVersionUID = 1L; 27 31 28 32 /** … … 30 34 */ 31 35 Iteration() { 32 super(" Iteration");36 super("iteration"); 33 37 } 34 38 35 /* 36 * (non-Javadoc) 37 * 38 * @see de.ugoe.cs.tasktree.treeifc.TaskTreeNode#addChild(TaskTreeNode) 39 /* (non-Javadoc) 40 * @see MarkingTemporalRelationship#setMarkedTask(ITask) 39 41 */ 40 42 @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); 43 protected void setMarkedTask(ITask markedTask) { 44 if (markedTask instanceof IIteration) { 45 throw new IllegalArgumentException 46 ("the marked task of an iteration must not be an iteration"); 56 47 } 57 super.addChild(child); 48 else if (markedTask instanceof IOptional) { 49 throw new IllegalArgumentException 50 ("the marked task of an iteration must not be an optional"); 51 } 52 53 super.setMarkedTask(markedTask); 58 54 } 59 55
Note: See TracChangeset
for help on using the changeset viewer.