Changeset 1127 for trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceOnSameTargetDetectionRule.java
- Timestamp:
- 03/18/13 11:54:15 (11 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceOnSameTargetDetectionRule.java
r1117 r1127 15 15 package de.ugoe.cs.autoquest.tasktrees.temporalrelation; 16 16 17 import java.util.List; 18 17 19 import de.ugoe.cs.autoquest.eventcore.IEventTarget; 18 20 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; … … 29 31 * @author 2012, last modified by $Author: patrick$ 30 32 */ 31 class DefaultEventTargetSequenceDetectionRule implements TemporalRelationshipRule {33 class SequenceOnSameTargetDetectionRule implements TemporalRelationshipRule { 32 34 33 35 /** … … 58 60 * the temporal relationships identified during rule application 59 61 */ 60 DefaultEventTargetSequenceDetectionRule(ITaskTreeNodeFactory taskTreeNodeFactory,61 62 SequenceOnSameTargetDetectionRule(ITaskTreeNodeFactory taskTreeNodeFactory, 63 ITaskTreeBuilder taskTreeBuilder) 62 64 { 63 65 this.taskTreeNodeFactory = taskTreeNodeFactory; … … 70 72 @Override 71 73 public String toString() { 72 return " DefaultEventTargetSequenceDetectionRule";74 return "SequenceOnSameTargetDetectionRule"; 73 75 } 74 76 … … 91 93 92 94 int index = 0; 93 while (index < parent.getChildren().size()) { 94 ITaskTreeNode child = parent.getChildren().get(index); 95 List<ITaskTreeNode> children = parent.getChildren(); 96 97 while (index < children.size()) { 98 ITaskTreeNode child = children.get(index); 95 99 96 100 IEventTarget eventTarget = determineEventTarget(child); … … 109 113 // or if this child is not a sequence itself 110 114 if ((startingIndex != endIndex) || 111 (!( parent.getChildren().get(startingIndex) instanceof ISequence)))115 (!(children.get(startingIndex) instanceof ISequence))) 112 116 { 113 117 handleEventTargetSequence 114 118 (parent, currentEventTarget, startingIndex, endIndex, result); 115 119 116 result.setRuleApplicationStatus 117 (RuleApplicationStatus.RULE_APPLICATION_FINISHED); 120 result.setRuleApplicationStatus(RuleApplicationStatus.FINISHED); 118 121 return result; 119 122 } … … 134 137 135 138 if (startingIndex > -1) { 136 int endIndex = parent.getChildren().size() - 1;139 int endIndex = children.size() - 1; 137 140 138 141 if (finalize) { … … 141 144 if ((startingIndex > 0) && 142 145 ((startingIndex != endIndex) || 143 (!( parent.getChildren().get(startingIndex) instanceof ISequence))))146 (!(children.get(startingIndex) instanceof ISequence)))) 144 147 { 145 148 handleEventTargetSequence 146 149 (parent, currentEventTarget, startingIndex, endIndex, result); 147 150 148 result.setRuleApplicationStatus(RuleApplicationStatus. RULE_APPLICATION_FINISHED);151 result.setRuleApplicationStatus(RuleApplicationStatus.FINISHED); 149 152 } 150 153 } 151 154 else { 152 result.setRuleApplicationStatus(RuleApplicationStatus. RULE_APPLICATION_FEASIBLE);155 result.setRuleApplicationStatus(RuleApplicationStatus.FEASIBLE); 153 156 } 154 157 }
Note: See TracChangeset
for help on using the changeset viewer.