Changeset 1733 for branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/StructuringTemporalRelationship.java
- Timestamp:
- 09/05/14 19:33:12 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/StructuringTemporalRelationship.java
r1357 r1733 23 23 /** 24 24 * <p> 25 * this is the default implementation of the interface {@link IStructuringTemporalRelationship}. It 26 * does not do anything fancy except implementing the interface. 25 * this is the default implementation of the interface 26 * {@link IStructuringTemporalRelationship}. It does not do anything fancy 27 * except implementing the interface. 27 28 * </p> 28 29 * 29 30 * @author Patrick Harms 30 31 */ 31 abstract class StructuringTemporalRelationship extends Task 32 implements IStructuringTemporalRelationship 33 { 32 abstract class StructuringTemporalRelationship extends Task implements 33 IStructuringTemporalRelationship { 34 34 35 /** 36 * <p> 37 * default serial version UID 38 * </p> 39 */ 40 private static final long serialVersionUID = 1L; 41 42 /** 43 * <p> 44 * the list of children of this temporal relationship 45 * </p> 46 */ 47 private List<ITask> children = new LinkedList<ITask>(); 35 /** 36 * <p> 37 * default serial version UID 38 * </p> 39 */ 40 private static final long serialVersionUID = 1L; 48 41 49 /** 50 * <p> 51 * initializes this temporal relationship with a human readable name 52 * </p> 53 * 54 * @param relationshipType the human readable name of this temporal relationship 55 */ 56 StructuringTemporalRelationship(String relationshipType) { 57 super(relationshipType); 58 59 if ((relationshipType == null) || ("".equals(relationshipType))) { 60 throw new IllegalArgumentException 61 ("the relationship type must be something meaningful"); 62 } 63 } 42 /** 43 * <p> 44 * the list of children of this temporal relationship 45 * </p> 46 */ 47 private List<ITask> children = new LinkedList<ITask>(); 64 48 65 /* (non-Javadoc) 66 * @see de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship#getChildren() 67 */ 68 @Override 69 public List<ITask> getChildren() { 70 return children; 71 } 49 /** 50 * <p> 51 * initializes this temporal relationship with a human readable name 52 * </p> 53 * 54 * @param relationshipType 55 * the human readable name of this temporal relationship 56 */ 57 StructuringTemporalRelationship(String relationshipType) { 58 super(relationshipType); 72 59 73 /* (non-Javadoc) 74 * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.Task#clone() 75 */ 76 @Override 77 public synchronized StructuringTemporalRelationship clone() { 78 StructuringTemporalRelationship clone = null; 79 clone = (StructuringTemporalRelationship) super.clone(); 80 81 clone.children = new LinkedList<ITask>(); 82 83 for (ITask child : this.children) { 84 clone.children.add(child.clone()); 85 } 60 if ((relationshipType == null) || ("".equals(relationshipType))) { 61 throw new IllegalArgumentException( 62 "the relationship type must be something meaningful"); 63 } 64 } 86 65 87 return clone; 88 } 66 /** 67 * <p> 68 * used to add a new child to this temporal relationship at a specific 69 * position. 70 * </p> 71 * 72 * @param index 73 * the index of the new child to be added. 74 * @param newChild 75 * the new child to be added 76 */ 77 void addChild(int index, ITask newChild) { 78 children.add(index, newChild); 79 } 89 80 90 /** 91 * <p> 92 * used to add a new child to this temporal relationship. 93 * </p> 94 * 95 * @param newChild the new child to be added 96 */ 97 void addChild(ITask newChild) { 98 children.add(newChild); 99 } 81 /** 82 * <p> 83 * used to add a new child to this temporal relationship. 84 * </p> 85 * 86 * @param newChild 87 * the new child to be added 88 */ 89 void addChild(ITask newChild) { 90 children.add(newChild); 91 } 100 92 101 /** 102 * <p> 103 * used to add a new child to this temporal relationship at a specific position. 104 * </p> 105 * 106 * @param index the index of the new child to be added. 107 * @param newChild the new child to be added 108 */ 109 void addChild(int index, ITask newChild) { 110 children.add(index, newChild); 111 } 112 113 /** 114 * <p> 115 * removes a child from this temporal relationship at a specific position. 116 * </p> 117 * 118 * @param index the index of the child to be removed. 119 */ 120 void removeChild(int index) { 121 children.remove(index); 122 } 93 /* 94 * (non-Javadoc) 95 * 96 * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.Task#clone() 97 */ 98 @Override 99 public synchronized StructuringTemporalRelationship clone() { 100 StructuringTemporalRelationship clone = null; 101 clone = (StructuringTemporalRelationship) super.clone(); 102 103 clone.children = new LinkedList<ITask>(); 104 105 for (final ITask child : this.children) { 106 clone.children.add(child.clone()); 107 } 108 109 return clone; 110 } 111 112 /* 113 * (non-Javadoc) 114 * 115 * @see 116 * de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship 117 * #getChildren() 118 */ 119 @Override 120 public List<ITask> getChildren() { 121 return children; 122 } 123 124 /** 125 * <p> 126 * removes a child from this temporal relationship at a specific position. 127 * </p> 128 * 129 * @param index 130 * the index of the child to be removed. 131 */ 132 void removeChild(int index) { 133 children.remove(index); 134 } 123 135 }
Note: See TracChangeset
for help on using the changeset viewer.