Changeset 1146 for trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskEquality.java
- Timestamp:
- 04/04/13 16:06:07 (11 years ago)
- Location:
- trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality
- Files:
-
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskEquality.java
r1113 r1146 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.tasktrees. nodeequality;15 package de.ugoe.cs.autoquest.tasktrees.taskequality; 16 16 17 17 /** 18 18 * <p> 19 * A node equality denotes, how equal two task tree nodes are. There are different equality levels19 * A task equality denotes, how equal two tasks are. There are different equality levels 20 20 * which are similar to the usual design levels of GUI design. These levels are 21 21 * <ul> … … 26 26 * can be performed</li> 27 27 * </ul> 28 * It is not possible to compare two task nodes conceptually. But the other design levels can be28 * It is not possible to compare two tasks conceptually. But the other design levels can be 29 29 * identified and compared. 30 30 * </p> 31 31 * <p> 32 * Nodes can be identical. This is the case if in the java virtual machine, their comparison32 * Tasks can be identical. This is the case if in the java virtual machine, their comparison 33 33 * using the <code>==</code> operator or the equals method return true. 34 34 * </p> 35 35 * <p> 36 * Nodes are lexically equal, if they represent the same events on a key stroke level to be37 * carried out to execute the task. Identical nodes are also syntactically equal.36 * Tasks are lexically equal, if they represent the same events on a key stroke level to be 37 * carried out to execute the task. Identical tasks are also syntactically equal. 38 38 * </p> 39 39 * <p> … … 41 41 * syntactical result is the same. For example, entering the text "hello" into a text field can 42 42 * be done by entering the letters in their correct order, but also by copying the text into the 43 * text field. The syntactical result is the same: The text hellowas entered. But the tasks43 * text field. The syntactical result is the same: The text "hello" was entered. But the tasks 44 44 * lexically differ because the events on key stroke level are different. On the other hand, 45 * lexically equal nodes are also syntactically equal.45 * lexically equal tasks are also syntactically equal. 46 46 * </p> 47 47 * <p> 48 * Task tree nodes are semantically equal, if they execute the same function for editing the49 * concepts. An example are a click on a button and a short cut, both executing the same function.50 * These task tree nodes are syntactically and, therefore, also lexically different, but51 * semantically equal. Syntactically equal task tree nodes are always also semantically equal.48 * Tasks are semantically equal, if they execute the same function for editing the concepts. An 49 * example are a click on a button and a short cut, both executing the same function. These tasks 50 * are syntactically and, therefore, also lexically different, but semantically equal. 51 * Syntactically equal tasks are always also semantically equal. 52 52 * </p> 53 53 * … … 55 55 * @author 2012, last modified by $Author: patrick$ 56 56 */ 57 public enum NodeEquality {57 public enum TaskEquality { 58 58 IDENTICAL, 59 59 LEXICALLY_EQUAL, … … 64 64 /** 65 65 * <p> 66 * Checks for the current nodeequality, if it is at least identical to the67 * provided one or even more concrete. As an example, the nodeequality identical also68 * indicates, that the nodes are e.g. lexically, syntactically and semantically equal.66 * Checks for the current task equality, if it is at least identical to the 67 * provided one or even more concrete. As an example, the task equality identical also 68 * indicates, that the tasks are e.g. lexically, syntactically and semantically equal. 69 69 * Therefore, the method called on <code>IDENTICAL</code> with <code>SEMANTICALLY_EQUAL</code> 70 70 * as parameter will return true. If this method is called on <code>SYNTACTICALLY_EQUAL</code> … … 72 72 * </p> 73 73 * 74 * @param nodeEquality the nodeequality to compare with.74 * @param taskEquality the task equality to compare with. 75 75 * 76 76 * @return as described 77 77 */ 78 public boolean isAtLeast( NodeEquality nodeEquality)78 public boolean isAtLeast(TaskEquality taskEquality) 79 79 { 80 switch ( nodeEquality) {80 switch (taskEquality) { 81 81 case IDENTICAL: 82 82 return … … 107 107 /** 108 108 * <p> 109 * returns the common denominator of this nodeequality and the provided one. I.e. if one109 * returns the common denominator of this task equality and the provided one. I.e. if one 110 110 * equality is e.g. syntactical and the other one only semantical, then semantical is returned. 111 111 * </p> 112 112 * 113 113 * @param equality the equality, to compare this with 114 * @return 114 * 115 * @return as described 115 116 */ 116 public NodeEquality getCommonDenominator(NodeEquality otherEquality) {117 public TaskEquality getCommonDenominator(TaskEquality otherEquality) { 117 118 if (this.isAtLeast(otherEquality)) { 118 119 return otherEquality; … … 122 123 } 123 124 else { 124 return NodeEquality.UNEQUAL;125 return TaskEquality.UNEQUAL; 125 126 } 126 127 }
Note: See TracChangeset
for help on using the changeset viewer.