Changeset 1294 for trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskIdentityRule.java
- Timestamp:
- 08/14/13 17:04:42 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskIdentityRule.java
r1146 r1294 16 16 17 17 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 18 19 19 20 /** 20 21 * <p> 21 22 * This comparison rule returns <code>TaskEquality.IDENTICAL</code> if the comparison of the two 22 * tasks using the <code>==</code> operator or the <code>equals</code> method return true.23 * Else it returns null to denote, thatit can not compare the tasks.23 * tasks using the <code>==</code> operator returns true. Else it returns null to denote, that 24 * it can not compare the tasks. 24 25 * </p> 25 26 * … … 30 31 31 32 /* (non-Javadoc) 32 * @see NodeComparisonRule#isApplicable(ITask, ITask)33 * @see TaskComparisonRule#isApplicable(ITask, ITask) 33 34 */ 34 35 @Override … … 38 39 39 40 /* (non-Javadoc) 40 * @see NodeComparisonRule#areLexicallyEqual(ITask, ITask)41 * @see TaskComparisonRule#areLexicallyEqual(ITask, ITask) 41 42 */ 42 43 @Override … … 46 47 47 48 /* (non-Javadoc) 48 * @see NodeComparisonRule#areSyntacticallyEqual(ITask, ITask)49 * @see TaskComparisonRule#areSyntacticallyEqual(ITask, ITask) 49 50 */ 50 51 @Override … … 54 55 55 56 /* (non-Javadoc) 56 * @see NodeComparisonRule#areSemanticallyEqual(ITask, ITask)57 * @see TaskComparisonRule#areSemanticallyEqual(ITask, ITask) 57 58 */ 58 59 @Override … … 62 63 63 64 /* (non-Javadoc) 64 * @see NodeComparisonRule#compare(ITask, ITask)65 * @see TaskComparisonRule#compare(ITask, ITask) 65 66 */ 66 67 @Override … … 74 75 } 75 76 77 /* (non-Javadoc) 78 * @see TaskComparisonRule#isApplicable(ITaskInstance, ITaskInstance) 79 */ 80 @Override 81 public boolean isApplicable(ITaskInstance instance1, ITaskInstance instance2) { 82 return (instance1.getTask() == instance2.getTask()); 83 } 84 85 /* (non-Javadoc) 86 * @see TaskComparisonRule#areLexicallyEqual(ITaskInstance, ITaskInstance) 87 */ 88 @Override 89 public boolean areLexicallyEqual(ITaskInstance instance1, ITaskInstance instance2) { 90 return (instance1.getTask() == instance2.getTask()); 91 } 92 93 /* (non-Javadoc) 94 * @see TaskComparisonRule#areSyntacticallyEqual(ITaskInstance, ITaskInstance) 95 */ 96 @Override 97 public boolean areSyntacticallyEqual(ITaskInstance instance1, ITaskInstance instance2) { 98 return (instance1.getTask() == instance2.getTask()); 99 } 100 101 /* (non-Javadoc) 102 * @see TaskComparisonRule#areSemanticallyEqual(ITaskInstance, ITaskInstance) 103 */ 104 @Override 105 public boolean areSemanticallyEqual(ITaskInstance instance1, ITaskInstance instance2) { 106 return (instance1.getTask() == instance2.getTask()); 107 } 108 109 /* (non-Javadoc) 110 * @see TaskComparisonRule#compare(ITaskInstance, ITaskInstance) 111 */ 112 @Override 113 public TaskEquality compare(ITaskInstance instance1, ITaskInstance instance2) { 114 if (isApplicable(instance1, instance2)) { 115 return TaskEquality.IDENTICAL; 116 } 117 else { 118 return null; 119 } 120 } 121 76 122 }
Note: See TracChangeset
for help on using the changeset viewer.