Index: trunk/autoquest-core-usageprofiles/src/main/java/de/ugoe/cs/autoquest/usageprofiles/TrieNode.java
===================================================================
--- trunk/autoquest-core-usageprofiles/src/main/java/de/ugoe/cs/autoquest/usageprofiles/TrieNode.java	(revision 1251)
+++ trunk/autoquest-core-usageprofiles/src/main/java/de/ugoe/cs/autoquest/usageprofiles/TrieNode.java	(revision 1282)
@@ -29,5 +29,5 @@
  * <p>
  * This class implements a node of a trie. Each node is associated with a symbol and has a counter.
- * The counter marks the number of occurences of the sequence defined by the path from the root of
+ * The counter marks the number of occurrences of the sequence defined by the path from the root of
  * the trie to this node.
  * </p>
@@ -50,5 +50,5 @@
     /**
      * <p>
-     * Counter for the number of occurences of the sequence.
+     * Counter for the number of occurrences of the sequence.
      * </p>
      */
@@ -71,8 +71,8 @@
     /**
      * <p>
-     * Comparator to be used for comparing the symbols with each other
-     * </p>
-     */
-    private SymbolComparator<T> comparator;
+     * Strategy for handling symbols, i.e., for comparing and storing them
+     * </p>
+     */
+    private SymbolStrategy<T> strategy;
 
     /**
@@ -80,9 +80,9 @@
      * Constructor. Creates a new TrieNode without a symbol associated.<br>
      * <b>This constructor should only be used to create the root node of the trie!</b>
-     * The comparator used by the tree node will be a {@link DefaultSymbolComparator}.
+     * The strategy used by the trie node will be a {@link DefaultSymbolStrategy}.
      * </p>
      */
     TrieNode() {
-        this(new DefaultSymbolComparator<T>());
+        this(new DefaultSymbolStrategy<T>());
     }
 
@@ -90,12 +90,15 @@
      * <p>
      * Constructor. Creates a new TrieNode. The symbol must not be null.
-     * The comparator used by the tree node will be a {@link DefaultSymbolComparator}.
+     * The strategy used by the trie node will be a {@link DefaultSymbolStrategy}.
      * </p>
      * 
      * @param symbol
      *            symbol associated with the trie node
+     * 
+     * @throws IllegalArgumentException
+     *            if the provided symbol is null
      */
     TrieNode(T symbol) {
-        this(symbol, new DefaultSymbolComparator<T>());
+        this(symbol, new DefaultSymbolStrategy<T>());
     }
 
@@ -103,29 +106,40 @@
      * <p>
      * Constructor. Creates a new TrieNode without a symbol associated using the provided
-     * comparator.<br>
+     * strategy.<br>
      * <b>This constructor should only be used to create the root node of the trie!</b>
-     * <br>The comparator must not be null.
-     * </p>
-     */
-    TrieNode(SymbolComparator<T> comparator) {
-        if (comparator == null) {
-            throw new IllegalArgumentException("comparator must not be null!");
-        }
-        this.comparator = comparator;
+     * <br>The strategy must not be null.
+     * </p>
+     * 
+     * @param strategy
+     *            the strategy used for comparing and storing symbols
+     * 
+     * @throws IllegalArgumentException
+     *            if the provided strategy is null
+     */
+    TrieNode(SymbolStrategy<T> strategy) {
+        if (strategy == null) {
+            throw new IllegalArgumentException("strategy must not be null!");
+        }
+        this.strategy = strategy;
         this.symbol = null;
         count = 0;
-        children = new SymbolMap<T, TrieNode<T>>(this.comparator);
-    }
-
-    /**
-     * <p>
-     * Constructor. Creates a new TrieNode using the provided comparator. The symbol and the
-     * comparator must not be null.
+        children = strategy.createSymbolMap();
+    }
+
+    /**
+     * <p>
+     * Constructor. Creates a new TrieNode using the provided strategy. The symbol and the
+     * strategy must not be null.
      * </p>
      * 
      * @param symbol
      *            symbol associated with the trie node
-     */
-    TrieNode(T symbol, SymbolComparator<T> comparator) {
+     * @param strategy
+     *            the strategy used for comparing and storing symbols
+     * 
+     * @throws IllegalArgumentException
+     *            if the provided symbol or strategy is null
+     */
+    TrieNode(T symbol, SymbolStrategy<T> strategy) {
         if (symbol == null) {
             throw new IllegalArgumentException
@@ -134,11 +148,11 @@
         this.symbol = symbol;
         
-        if (comparator == null) {
-            throw new IllegalArgumentException("comparator must not be null!");
-        }
-        this.comparator = comparator;
+        if (strategy == null) {
+            throw new IllegalArgumentException("strategy must not be null!");
+        }
+        this.strategy = strategy;
 
         count = 0;
-        children = new SymbolMap<T, TrieNode<T>>(this.comparator);
+        children = strategy.createSymbolMap();
     }
 
@@ -148,5 +162,8 @@
      * </p>
      * 
-     * @param other
+     * @param other the trie node to create the copy of
+     * 
+     * @throws IllegalArgumentException
+     *            if the provided node is null
      */
     TrieNode(TrieNode<T> other) {
@@ -156,6 +173,6 @@
         symbol = other.symbol;
         count = other.count;
-        comparator = other.comparator;
-        children = new SymbolMap<T, TrieNode<T>>(this.comparator);
+        strategy = other.strategy;
+        children = strategy.createSymbolMap();
         
         for (TrieNode<T> child : other.children.getValues()) {
@@ -175,6 +192,6 @@
     public void add(List<T> subsequence) {
         if (!subsequence.isEmpty()) {
-            if (!comparator.equals(symbol, subsequence.get(0))) { // should be guaranteed by
-                                                                  // the recursion/TrieRoot!
+            if (!strategy.getSymbolComparator().equals(symbol, subsequence.get(0))) {
+                // should be guaranteed by the recursion/TrieRoot!
                 throw new AssertionError("Invalid trie operation!");
             }
@@ -201,8 +218,8 @@
     /**
      * <p>
-     * Returns the number of occurences of the sequence represented by the node.
-     * </p>
-     * 
-     * @return number of occurences of the sequence represented by the node
+     * Returns the number of occurrences of the sequence represented by the node.
+     * </p>
+     * 
+     * @return number of occurrences of the sequence represented by the node
      */
     public int getCount() {
@@ -224,5 +241,5 @@
         TrieNode<T> node = getChild(symbol);
         if (node == null) {
-            node = new TrieNode<T>(symbol, comparator);
+            node = new TrieNode<T>(symbol, strategy);
             children.addSymbol(symbol, node);
         }
@@ -283,5 +300,5 @@
     /**
      * <p>
-     * Returns a collection of all symbols that follow a this node, i.e., the symbols associated
+     * Returns a collection of all symbols that follow this node, i.e., the symbols associated
      * with the children of this node.
      * </p>
@@ -399,5 +416,5 @@
     /**
      * <p>
-     * Recursive methods that collects all nodes that are ancestors of leafs and stores them in the
+     * Recursive method that collects all nodes that are ancestors of leafs and stores them in the
      * set.
      * </p>
@@ -457,5 +474,6 @@
      * <p>
      * Two TrieNodes are defined as equal, if their {@link #count}, {@link #symbol}, and
-     * {@link #children} are equal. For the comparison of their symbols the comparator is used.
+     * {@link #children} are equal. For the comparison of their symbols the comparator provided
+     * by the symbol management strategy is used.
      * </p>
      * 
@@ -477,5 +495,5 @@
                 return count == otherNode.count &&
                     symbol.getClass().isInstance(((TrieNode) other).symbol) &&
-                    comparator.equals(symbol, ((TrieNode<T>) other).symbol) &&
+                    strategy.getSymbolComparator().equals(symbol, ((TrieNode<T>) other).symbol) &&
                     children.equals(((TrieNode) other).children);
             }
