Last change
on this file since 818 was
807,
checked in by pharms, 12 years ago
|
- improved node equality comparison to match the principle of lexical, syntactical and semantical node equality. As a result, more condensed task trees are created.
|
-
Property svn:executable set to
*
|
File size:
934 bytes
|
Line | |
---|
1 | package de.ugoe.cs.quest.tasktrees.nodeequality; |
---|
2 | |
---|
3 | import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode; |
---|
4 | |
---|
5 | /** |
---|
6 | * <p> |
---|
7 | * This comparison rule returns <code>NodeEquality.IDENTICAL</code> if the comparison of the two |
---|
8 | * task tree nodes using the <code>==</code> operator or the <code>equals</code> method return true. |
---|
9 | * Else it returns null to denote, that it can not compare the nodes. |
---|
10 | * </p> |
---|
11 | * |
---|
12 | * @version $Revision: $ $Date: 19.02.2012$ |
---|
13 | * @author 2012, last modified by $Author: patrick$ |
---|
14 | */ |
---|
15 | public class NodeIdentityRule implements NodeComparisonRule { |
---|
16 | |
---|
17 | /* |
---|
18 | * (non-Javadoc) |
---|
19 | * |
---|
20 | * @see de.ugoe.cs.tasktree.nodeequality.NodeEqualityRule#apply(TaskTreeNode, TaskTreeNode) |
---|
21 | */ |
---|
22 | @Override |
---|
23 | public NodeEquality compare(ITaskTreeNode node1, ITaskTreeNode node2) { |
---|
24 | if (node1 == node2) { |
---|
25 | return NodeEquality.IDENTICAL; |
---|
26 | } |
---|
27 | else { |
---|
28 | return null; |
---|
29 | } |
---|
30 | } |
---|
31 | |
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.