source: trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeIdentityRule.java @ 655

Last change on this file since 655 was 655, checked in by pharms, 12 years ago
  • removed old copyright file header
  • Property svn:executable set to *
File size: 982 bytes
Line 
1package de.ugoe.cs.quest.tasktrees.nodeequality;
2
3import 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 */
15public 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) || ((node1 != null) && (node1.equals(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.