Changeset 807 for trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/SequenceComparisonRule.java
- Timestamp:
- 09/11/12 16:45:51 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/SequenceComparisonRule.java
r655 r807 44 44 } 45 45 46 if (node1 == node2) { 47 return NodeEquality.IDENTICAL; 48 } 49 46 50 // if both sequences do not have children, they are equal although this doesn't make sense 47 51 if ((node1.getChildren().size() == 0) && (node2.getChildren().size() == 0)) { … … 49 53 } 50 54 51 //52 55 if (node1.getChildren().size() != node2.getChildren().size()) { 53 return null;56 return NodeEquality.UNEQUAL; 54 57 } 55 58 59 NodeEquality resultingEquality = NodeEquality.LEXICALLY_EQUAL; 56 60 for (int i = 0; i < node1.getChildren().size(); i++) { 57 61 ITaskTreeNode child1 = node1.getChildren().get(i); … … 60 64 NodeEquality nodeEquality = mRuleManager.applyRules(child1, child2); 61 65 62 if ( !nodeEquality.isAtLeast(NodeEquality.LEXICALLY_EQUAL)) {63 return null;66 if ((nodeEquality == null) || (nodeEquality == NodeEquality.UNEQUAL)) { 67 return NodeEquality.UNEQUAL; 64 68 } 69 70 resultingEquality = resultingEquality.getCommonDenominator(nodeEquality); 65 71 } 66 72 67 return NodeEquality.LEXICALLY_EQUAL;73 return resultingEquality; 68 74 } 69 75
Note: See TracChangeset
for help on using the changeset viewer.