Ignore:
Timestamp:
09/11/12 16:45:51 (12 years ago)
Author:
pharms
Message:
  • improved node equality comparison to match the principle of lexical, syntactical and semantical node equality. As a result, more condensed task trees are created.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEquality.java

    r655 r807  
    9090        } 
    9191    } 
     92 
     93    /** 
     94     * <p> 
     95     * returns the common denominator of this node equality and the provided one. I.e. if one 
     96     * equality is e.g. syntactical and the other one only semantical, then semantical is returned. 
     97     * </p> 
     98     * 
     99     * @param equality the equality, to compare this with 
     100     * @return 
     101     */ 
     102    public NodeEquality getCommonDenominator(NodeEquality otherEquality) { 
     103        if (this.isAtLeast(otherEquality)) { 
     104            return otherEquality; 
     105        } 
     106        else if (otherEquality.isAtLeast(this)) { 
     107            return this; 
     108        } 
     109        else { 
     110            return NodeEquality.UNEQUAL; 
     111        } 
     112    } 
    92113} 
Note: See TracChangeset for help on using the changeset viewer.