Ignore:
Timestamp:
08/14/13 17:04:42 (11 years ago)
Author:
pharms
Message:
  • rework of task model to move event instance stuff to task instances
  • introduction of sequence, selection, iteration and optional instances
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskIdentityRule.java

    r1146 r1294  
    1616 
    1717import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
     18import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 
    1819 
    1920/** 
    2021 * <p> 
    2122 * 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, that it 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. 
    2425 * </p> 
    2526 *  
     
    3031 
    3132    /* (non-Javadoc) 
    32      * @see NodeComparisonRule#isApplicable(ITask, ITask) 
     33     * @see TaskComparisonRule#isApplicable(ITask, ITask) 
    3334     */ 
    3435    @Override 
     
    3839 
    3940    /* (non-Javadoc) 
    40      * @see NodeComparisonRule#areLexicallyEqual(ITask, ITask) 
     41     * @see TaskComparisonRule#areLexicallyEqual(ITask, ITask) 
    4142     */ 
    4243    @Override 
     
    4647 
    4748    /* (non-Javadoc) 
    48      * @see NodeComparisonRule#areSyntacticallyEqual(ITask, ITask) 
     49     * @see TaskComparisonRule#areSyntacticallyEqual(ITask, ITask) 
    4950     */ 
    5051    @Override 
     
    5455 
    5556    /* (non-Javadoc) 
    56      * @see NodeComparisonRule#areSemanticallyEqual(ITask, ITask) 
     57     * @see TaskComparisonRule#areSemanticallyEqual(ITask, ITask) 
    5758     */ 
    5859    @Override 
     
    6263 
    6364    /* (non-Javadoc) 
    64      * @see NodeComparisonRule#compare(ITask, ITask) 
     65     * @see TaskComparisonRule#compare(ITask, ITask) 
    6566     */ 
    6667    @Override 
     
    7475    } 
    7576 
     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 
    76122} 
Note: See TracChangeset for help on using the changeset viewer.