Index: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceComparator.java
===================================================================
--- trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceComparator.java	(revision 1394)
+++ trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceComparator.java	(revision 1401)
@@ -26,5 +26,11 @@
 
 /**
- * TODO comment
+ * <p>
+ * implementation of a symbol comparator for task instances. Internally, it uses comparison buffers
+ * to prevent comparing two tasks or task instances several times. It internally instantiates
+ * comparers being the implementation strategy of the comparisons required for a specific level
+ * of task equality. The comparers internally use the {@link TaskEqualityRuleManager} for
+ * performing comparisons.
+ * </p>
  */
 public class TaskInstanceComparator implements SymbolComparator<ITaskInstance> {
@@ -33,27 +39,43 @@
     private static final long serialVersionUID = 1L;
     
-    /** */
+    /**
+     * the maximum size of the internal buffer used for storing comparison results
+     */
     private static final int MAX_BUFFER_SIZE = 2 * 1024 * 1024;
 
-    /** */
-    private TaskEquality minimalNodeEquality;
-
-    /** */
+    /**
+     * the considered level of task equality
+     */
+    private TaskEquality minimalTaskEquality;
+
+    /**
+     * the comparer used internally for comparing two tasks
+     */
     private transient Comparer comparer;
 
-    /** */
+    /**
+     * the comparer used for comparing two tasks on the lexical level
+     */
     private transient Comparer lexicalComparer;
 
-    /** */
+    /**
+     * internal buffer used for storing comparison results
+     */
     private transient HashMap<Long, Boolean> equalityBuffer = new HashMap<Long, Boolean>();
 
-    /** */
+    /**
+     * internal buffer used for storing comparison results only for lexical comparisons
+     */
     private transient HashMap<Long, Boolean> lexicalEqualityBuffer;
 
     /**
-     *
-     */
-    public TaskInstanceComparator(TaskEquality minimalNodeEquality) {
-        this.minimalNodeEquality = minimalNodeEquality;
+     * <p>
+     * initializes the comparator with a considered task equality level
+     * </p>
+     * 
+     * @param minimalTaskEquality the considered task equality level
+     */
+    public TaskInstanceComparator(TaskEquality minimalTaskEquality) {
+        this.minimalTaskEquality = minimalTaskEquality;
         init();
     }
@@ -68,5 +90,12 @@
 
     /**
-     * 
+     * <p>
+     * returns true, if this comparator considers the provided tasks as equal, false else
+     * </p>
+     * 
+     * @param task1 the first task to compare
+     * @param task2 the second task to compare
+     * 
+     * @return as described
      */
     public boolean equals(ITask task1, ITask task2) {
@@ -100,5 +129,12 @@
 
     /**
-     *
+     * <p>
+     * returns true, if this comparator considers the provided tasks as lexically equal, false else
+     * </p>
+     * 
+     * @param task1 the first task to compare
+     * @param task2 the second task to compare
+     * 
+     * @return as described
      */
     public boolean areLexicallyEqual(ITask task1, ITask task2) {
@@ -127,7 +163,6 @@
     /**
      * <p>
-     * TODO: comment
-     * </p>
-     *
+     * can be called externally to clear the internal comparison buffers
+     * </p>
      */
     public void clearBuffers() {
@@ -137,21 +172,25 @@
     
     /**
-     * 
+     * <p>
+     * initializes the comparator with comparers depending on the different comparison levels as
+     * well as with the required comparison buffers. Comparers and buffers for lexical comparison
+     * may be reused if the considered equality level is also lexical.
+     * </p>
      */
     private void init() {
-        if (minimalNodeEquality == TaskEquality.LEXICALLY_EQUAL) {
+        if (minimalTaskEquality == TaskEquality.LEXICALLY_EQUAL) {
             comparer = new LexicalComparer();
         }
-        else if (minimalNodeEquality == TaskEquality.SYNTACTICALLY_EQUAL) {
+        else if (minimalTaskEquality == TaskEquality.SYNTACTICALLY_EQUAL) {
             comparer = new SyntacticalComparer();
         }
-        else if (minimalNodeEquality == TaskEquality.SEMANTICALLY_EQUAL) {
+        else if (minimalTaskEquality == TaskEquality.SEMANTICALLY_EQUAL) {
             comparer = new SemanticalComparer();
         }
         else {
-            comparer = new DefaultComparer(this.minimalNodeEquality);
-        }
-        
-        if (minimalNodeEquality == TaskEquality.LEXICALLY_EQUAL) {
+            comparer = new DefaultComparer(this.minimalTaskEquality);
+        }
+        
+        if (minimalTaskEquality == TaskEquality.LEXICALLY_EQUAL) {
             lexicalComparer = comparer;
             lexicalEqualityBuffer = equalityBuffer;
@@ -175,10 +214,19 @@
 
     /**
-     * 
+     * <p>
+     * interface for internally used comparers containing only a compare method
+     * </p>
      */
     private static interface Comparer {
         
         /**
+         * <p>
+         * returns true, if this comparator considers the provided tasks as equal, false else
+         * </p>
          * 
+         * @param task1 the first task to compare
+         * @param task2 the second task to compare
+         * 
+         * @return as described
          */
         boolean compare(ITask task1, ITask task2);
@@ -186,10 +234,12 @@
 
     /**
-     * 
+     * <p>
+     * comparer that performs comparisons only on the lexical level
+     * </p>
      */
     private static class LexicalComparer implements Comparer {
         
-        /**
-         * 
+        /* (non-Javadoc)
+         * @see Comparer#compare(ITask, ITask)
          */
         public boolean compare(ITask task1, ITask task2) {
@@ -199,10 +249,13 @@
 
     /**
+     * <p>
+     * comparer that performs comparisons only on the syntactical level
+     * </p>
      * 
      */
     private static class SyntacticalComparer implements Comparer {
         
-        /**
-         * 
+        /* (non-Javadoc)
+         * @see Comparer#compare(ITask, ITask)
          */
         public boolean compare(ITask task1, ITask task2) {
@@ -212,10 +265,12 @@
 
     /**
-     * 
+     * <p>
+     * comparer that performs comparisons only on the semantical level
+     * </p>
      */
     private static class SemanticalComparer implements Comparer {
         
-        /**
-         * 
+        /* (non-Javadoc)
+         * @see Comparer#compare(ITask, ITask)
          */
         public boolean compare(ITask task1, ITask task2) {
@@ -225,5 +280,7 @@
 
     /**
-     * 
+     * <p>
+     * comparer that performs comparisons only on the provided level
+     * </p>
      */
     private static class DefaultComparer implements Comparer {
@@ -231,22 +288,24 @@
         /**
          * <p>
-         * the minimal task equality two identified sublists need to have to consider them as equal
+         * the minimal task equality considered by this comparer
          * </p>
          */
-        private TaskEquality minimalNodeEquality;
+        private TaskEquality minimalTaskEquality;
         
         /**
-         *
-         */
-        public DefaultComparer(TaskEquality minimalNodeEquality) {
-           this.minimalNodeEquality = minimalNodeEquality;
-        }
-        
-        /**
-         * 
+         * <p>
+         * initializes this comparer with the task equality to be considered
+         * </p>
+         */
+        public DefaultComparer(TaskEquality minimalTaskEquality) {
+           this.minimalTaskEquality = minimalTaskEquality;
+        }
+        
+        /* (non-Javadoc)
+         * @see Comparer#compare(ITask, ITask)
          */
         public boolean compare(ITask task1, ITask task2) {
             return TaskEqualityRuleManager.getInstance().areAtLeastEqual
-                (task1, task2, minimalNodeEquality);
+                (task1, task2, minimalTaskEquality);
         }
     }
