Index: trunk/EventBenchCore/src/de/ugoe/cs/eventbench/IReplayDecorator.java
===================================================================
--- trunk/EventBenchCore/src/de/ugoe/cs/eventbench/IReplayDecorator.java	(revision 102)
+++ trunk/EventBenchCore/src/de/ugoe/cs/eventbench/IReplayDecorator.java	(revision 106)
@@ -3,12 +3,53 @@
 import java.io.Serializable;
 
+/**
+ * <p>
+ * This interface defines the structure of decorators used when writing replay
+ * files.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
 public interface IReplayDecorator extends Serializable {
-	
+
+	/**
+	 * <p>
+	 * Header of the file. Called at the beginning of the writing.
+	 * </p>
+	 * 
+	 * @return file header
+	 */
 	String getHeader();
-	
+
+	/**
+	 * <p>
+	 * Footer of the file. Called at the end of the writing.
+	 * </p>
+	 * 
+	 * @return file footer
+	 */
 	String getFooter();
-	
+
+	/**
+	 * <p>
+	 * Session Header. Called before each session.
+	 * </p>
+	 * 
+	 * @param sessionId
+	 *            id of the session
+	 * @return session header
+	 */
 	String getSessionHeader(int sessionId);
-	
+
+	/**
+	 * <p>
+	 * Session Footer. Called after each session.
+	 * </p>
+	 * 
+	 * @param sessionId
+	 *            id of the session
+	 * @return session footer
+	 */
 	String getSessionFooter(int sessionId);
 }
Index: trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculator.java
===================================================================
--- trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculator.java	(revision 102)
+++ trunk/EventBenchCore/src/de/ugoe/cs/eventbench/coverage/CoverageCalculator.java	(revision 106)
@@ -12,63 +12,165 @@
 import de.ugoe.cs.eventbench.models.IStochasticProcess;
 
+/**
+ * <p>
+ * This class calculates various types of sequence coverage.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
 public class CoverageCalculator {
-	
+
+	/**
+	 * <p>
+	 * Stochastic process that is the foundation for probabilistic coverages and
+	 * coverages with reference to all possible sequences.
+	 * </p>
+	 */
 	private final IStochasticProcess process;
+
+	/**
+	 * <p>
+	 * Sequences for which the coverage is calculated.
+	 * </p>
+	 */
 	private final Collection<List<? extends Event<?>>> sequences;
+
+	/**
+	 * <p>
+	 * Length of the subsequences in relation to which the covarage is
+	 * calculated.
+	 * </p>
+	 */
 	private final int length;
-	
+
+	/**
+	 * <p>
+	 * All subsequences of {@link #length} of {@link #sequences}.
+	 * </p>
+	 */
 	private Collection<List<? extends Event<?>>> containedSubSeqs = null;
+
+	/**
+	 * <p>
+	 * All subsequences of {@link #length} that can be generated by
+	 * {@link #process}.
+	 * </p>
+	 */
 	private Collection<List<? extends Event<?>>> allPossibleSubSeqs = null;
+
+	/**
+	 * <p>
+	 * The probabilities of al subsequences of {@link #length} according to
+	 * {@link #process}.
+	 * </p>
+	 */
 	private Map<List<? extends Event<?>>, Double> subSeqWeights = null;
-	
-	
-	public CoverageCalculator(IStochasticProcess process, Collection<List<? extends Event<?>>> sequences, int length) {
+
+	/**
+	 * <p>
+	 * Constructor. Creates a new CoverageCalculator for a given stochastic
+	 * process and generated sequences.
+	 * </p>
+	 * 
+	 * @param process
+	 *            stochastic process used for coverage calculations; if it is
+	 *            zero, not all calculations are possible
+	 * @param sequences
+	 *            sequences for which the coverage is calculated; must not be
+	 *            null.
+	 * @param length
+	 *            length of the subsequences for which the coverage is analyzed;
+	 *            must be >0
+	 */
+	public CoverageCalculator(IStochasticProcess process,
+			Collection<List<? extends Event<?>>> sequences, int length) {
+		// TODO check parameters
 		this.process = process;
 		this.sequences = sequences;
 		this.length = length;
 	}
-	
-
+
+	/**
+	 * <p>
+	 * Calculates the percentage of subsequences of length k that exist occur,
+	 * including those that cannot be generated by {@link #process}.
+	 * </p>
+	 * 
+	 * @return coverage percentage
+	 */
 	public double getCoverageAllNoWeight() {
-		if( containedSubSeqs==null ) {
+		if (containedSubSeqs == null) {
 			containedSubSeqs = containedSubSequences(sequences, length);
 		}
-		return((double) containedSubSeqs.size())/numSequences(process, length);
-	}
-	
+		return ((double) containedSubSeqs.size())
+				/ numSequences(process, length);
+	}
+
+	/**
+	 * <p>
+	 * Calculates the percentage of subsequences of length k that occur and can
+	 * generated by {@link #process}.
+	 * </p>
+	 * 
+	 * @return coverage percentage
+	 */
 	public double getCoveragePossibleNoWeight() {
-		if( containedSubSeqs==null ) {
+		if (containedSubSeqs == null) {
 			containedSubSeqs = containedSubSequences(sequences, length);
 		}
-		if( allPossibleSubSeqs==null ) {
+		if (allPossibleSubSeqs == null) {
 			allPossibleSubSeqs = process.generateSequences(length);
 		}
-		return((double) containedSubSeqs.size())/allPossibleSubSeqs.size();
-	}
-	
+		return ((double) containedSubSeqs.size()) / allPossibleSubSeqs.size();
+	}
+
+	/**
+	 * <p>
+	 * Calculates the weight of the subsequences that occur with relation to
+	 * {@link #process}, i.e., the mass of the subsequence probability covered
+	 * by the subsequences.
+	 * </p>
+	 * 
+	 * @return coverage weight
+	 */
 	public double getCoveragePossibleWeight() {
-		if( containedSubSeqs==null ) {
+		if (containedSubSeqs == null) {
 			containedSubSeqs = containedSubSequences(sequences, length);
 		}
-		if( allPossibleSubSeqs==null ) {
+		if (allPossibleSubSeqs == null) {
 			allPossibleSubSeqs = process.generateSequences(length);
 		}
-		if( subSeqWeights==null ) {
+		if (subSeqWeights == null) {
 			subSeqWeights = generateWeights(process, allPossibleSubSeqs);
 		}
 		double weight = 0.0;
-		for( List<? extends Event<?>> subSeq : containedSubSeqs ) {
+		for (List<? extends Event<?>> subSeq : containedSubSeqs) {
 			weight += subSeqWeights.get(subSeq);
 		}
 		return weight;
 	}
-	
-	private Map<List<? extends Event<?>>, Double> generateWeights(IStochasticProcess process, Collection<List<? extends Event<?>>> sequences) {
+
+	/**
+	 * <p>
+	 * Calculates the weights for all sequences passed to this function as
+	 * defined by the stochastic process and stores them in a {@link Map}.
+	 * </p>
+	 * 
+	 * @param process
+	 *            process used for weight calculation
+	 * @param sequences
+	 *            sequences for which the weights are calculated
+	 * @return {@link Map} of weights
+	 */
+	private static Map<List<? extends Event<?>>, Double> generateWeights(
+			IStochasticProcess process,
+			Collection<List<? extends Event<?>>> sequences) {
 		Map<List<? extends Event<?>>, Double> subSeqWeights = new LinkedHashMap<List<? extends Event<?>>, Double>();
 		double sum = 0.0;
-		for( List<? extends Event<?>> sequence : sequences ) {
+		for (List<? extends Event<?>> sequence : sequences) {
 			double prob = 1.0;
 			List<Event<?>> context = new LinkedList<Event<?>>();
-			for( Event<?> event : sequence ) {
+			for (Event<?> event : sequence) {
 				prob *= process.getProbability(context, event);
 				context.add(event);
@@ -77,33 +179,59 @@
 			sum += prob;
 		}
-		if( sum<1.0 ) {
-			for( Map.Entry<List<? extends Event<?>>, Double> entry : subSeqWeights.entrySet() ) {
-				entry.setValue(entry.getValue()/sum);
+		if (sum < 1.0) {
+			for (Map.Entry<List<? extends Event<?>>, Double> entry : subSeqWeights
+					.entrySet()) {
+				entry.setValue(entry.getValue() / sum);
 			}
 		}
 		return subSeqWeights;
 	}
-	
-	private long numSequences(IStochasticProcess process, int length) {
+
+	/**
+	 * <p>
+	 * Calculates the number of all existing sequences of a given length,
+	 * regardless whether they are possible or not.
+	 * </p>
+	 * 
+	 * @param process
+	 *            stochastic process whose symbols are the basis for this
+	 *            calculation
+	 * @param length
+	 *            lenght of the sequences
+	 * @return numStates^length
+	 */
+	private static long numSequences(IStochasticProcess process, int length) {
 		return (long) Math.pow(process.getNumStates(), length);
 	}
-	
-	// O(numSeq*lenSeq)	
-	private Set<List<? extends Event<?>>> containedSubSequences(Collection<List<? extends Event<?>>> sequences, int length) {
+
+	/**
+	 * <p>
+	 * Creates a {@link Set} of all subsequences of a given length that are
+	 * contained in a sequence collection.
+	 * </p>
+	 * 
+	 * @param sequences
+	 *            sequences from which the subsequences are extracted
+	 * @param length
+	 *            length of the subsequences
+	 * @return {@link Set} of all subsequences
+	 */
+	private static Set<List<? extends Event<?>>> containedSubSequences(
+			Collection<List<? extends Event<?>>> sequences, int length) {
 		Set<List<? extends Event<?>>> containedSubSeqs = new LinkedHashSet<List<? extends Event<?>>>();
 		List<Event<?>> subSeq = new LinkedList<Event<?>>();
 		boolean minLengthReached = false;
-		for( List<? extends Event<?>> sequence : sequences ) {
-			for( Event<?> event : sequence ) {
+		for (List<? extends Event<?>> sequence : sequences) {
+			for (Event<?> event : sequence) {
 				subSeq.add(event);
-				if( !minLengthReached ) {
-					if( subSeq.size()==length ) {
-						minLengthReached=true;
+				if (!minLengthReached) {
+					if (subSeq.size() == length) {
+						minLengthReached = true;
 					}
 				} else {
 					subSeq.remove(0);
 				}
-				if( minLengthReached ) {
-					if( !containedSubSeqs.contains(subSeq) ) {
+				if (minLengthReached) {
+					if (!containedSubSeqs.contains(subSeq)) {
 						containedSubSeqs.add(new LinkedList<Event<?>>(subSeq));
 					}
@@ -113,4 +241,4 @@
 		return containedSubSeqs;
 	}
-	
+
 }
Index: trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/IncompleteMemory.java
===================================================================
--- trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/IncompleteMemory.java	(revision 102)
+++ trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/IncompleteMemory.java	(revision 106)
@@ -4,18 +4,54 @@
 import java.util.List;
 
+/**
+ * <p>
+ * Implements a round-trip buffered memory of a specified length that can be
+ * used to remember the recent history. Every event that happend longer ago than
+ * the length of the memory is forgotten, hence the memory is incomplete.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ * 
+ * @param <T>
+ *            Type which is memorized.
+ */
 public class IncompleteMemory<T> implements IMemory<T> {
 
+	/**
+	 * <p>
+	 * Maximum length of the memory.
+	 * </p>
+	 */
 	private int length;
-	
+
+	/**
+	 * <p>
+	 * Internal storage of the history.
+	 * </p>
+	 */
 	private List<T> history;
-	
+
+	/**
+	 * <p>
+	 * Constructor. Creates a new IncompleteMemory.
+	 * </p>
+	 * 
+	 * @param length
+	 *            number of recent events that are remembered
+	 */
 	public IncompleteMemory(int length) {
 		this.length = length;
 		history = new LinkedList<T>();
 	}
-	
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.eventbench.models.IMemory#add(java.lang.Object)
+	 */
 	@Override
 	public void add(T state) {
-		if( history.size()==length ) {
+		if (history.size() == length) {
 			history.remove(0);
 		}
@@ -23,4 +59,9 @@
 	}
 
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.eventbench.models.IMemory#getLast(int)
+	 */
 	@Override
 	public List<T> getLast(int num) {
@@ -28,4 +69,12 @@
 	}
 
+	/**
+	 * <p>
+	 * Returns the current length of the memory. This can be less than
+	 * {@link #length}, if the overall history is less than {@link #length}.
+	 * </p>
+	 * 
+	 * @return length of the current memory
+	 */
 	public int getLength() {
 		return history.size();
Index: trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/Trie.java
===================================================================
--- trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/Trie.java	(revision 102)
+++ trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/Trie.java	(revision 106)
@@ -6,55 +6,111 @@
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Set;
 
 import de.ugoe.cs.util.StringTools;
 
 import edu.uci.ics.jung.graph.DelegateTree;
+import edu.uci.ics.jung.graph.Graph;
 import edu.uci.ics.jung.graph.Tree;
 
+/**
+ * <p>
+ * This class implements a <it>trie</it>, i.e., a tree of sequences that the
+ * occurence of subsequences up to a predefined length. This length is the trie
+ * order.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * 
+ * @param <T>
+ *            Type of the symbols that are stored in the trie.
+ * 
+ * @see TrieNode
+ */
 public class Trie<T> implements IDotCompatible, Serializable {
-	
-	/**
+
+	/**
+	 * <p>
 	 * Id for object serialization.
+	 * </p>
 	 */
 	private static final long serialVersionUID = 1L;
 
-	private Set<T> knownSymbols;
-	
+	/**
+	 * <p>
+	 * Collection of all symbols occuring in the trie.
+	 * </p>
+	 */
+	private Collection<T> knownSymbols;
+
+	/**
+	 * <p>
+	 * Reference to the root of the trie.
+	 * </p>
+	 */
 	private final TrieNode<T> rootNode;
-	
+
+	/**
+	 * <p>
+	 * Contructor. Creates a new Trie.
+	 * </p>
+	 */
 	public Trie() {
 		rootNode = new TrieNode<T>();
 		knownSymbols = new LinkedHashSet<T>();
 	}
-	
-	public Set<T> getKnownSymbols() {
+
+	/**
+	 * <p>
+	 * Returns a collection of all symbols occuring in the trie.
+	 * </p>
+	 * 
+	 * @return symbols occuring in the trie
+	 */
+	public Collection<T> getKnownSymbols() {
 		return new LinkedHashSet<T>(knownSymbols);
 	}
-	
-	// trains the current Trie using the given sequence and adds all subsequence of length trieOrder
+
+	/**
+	 * <p>
+	 * Trains the current trie using the given sequence and adds all subsequence
+	 * of length {@code maxOrder}.
+	 * </p>
+	 * 
+	 * @param sequence
+	 *            sequence whose subsequences are added to the trie
+	 * @param maxOrder
+	 *            maximum length of the subsequences added to the trie
+	 */
 	public void train(List<T> sequence, int maxOrder) {
 		IncompleteMemory<T> latestActions = new IncompleteMemory<T>(maxOrder);
-		int i=0;
-		for(T currentEvent : sequence) {
+		int i = 0;
+		for (T currentEvent : sequence) {
 			latestActions.add(currentEvent);
 			knownSymbols.add(currentEvent);
 			i++;
-			if( i>=maxOrder ) {
+			if (i >= maxOrder) {
 				add(latestActions.getLast(maxOrder));
 			}
 		}
 		int sequenceLength = sequence.size();
-		for( int j=maxOrder-1 ; j>0 ; j-- ) {
-			add(sequence.subList(sequenceLength-j, sequenceLength));
-		}
-	}
-	
-
-	// increases the counters for each symbol in the subsequence
-	public void add(List<T> subsequence) {
-		if( subsequence!=null && !subsequence.isEmpty() ) {
+		for (int j = maxOrder - 1; j > 0; j--) {
+			add(sequence.subList(sequenceLength - j, sequenceLength));
+		}
+	}
+
+	/**
+	 * <p>
+	 * Adds a given subsequence to the trie and increases the counters
+	 * accordingly.
+	 * </p>
+	 * 
+	 * @param subsequence
+	 *            subsequence whose counters are increased
+	 * @see TrieNode#add(List)
+	 */
+	protected void add(List<T> subsequence) {
+		if (subsequence != null && !subsequence.isEmpty()) {
 			knownSymbols.addAll(subsequence);
-			subsequence = new LinkedList<T>(subsequence);  // defensive copy!
+			subsequence = new LinkedList<T>(subsequence); // defensive copy!
 			T firstSymbol = subsequence.get(0);
 			TrieNode<T> node = getChildCreate(firstSymbol);
@@ -63,32 +119,86 @@
 	}
 
-	protected TrieNode<T>  getChildCreate(T symbol) {
+	/**
+	 * <p>
+	 * Returns the child of the root node associated with the given symbol or
+	 * creates it if it does not exist yet.
+	 * </p>
+	 * 
+	 * @param symbol
+	 *            symbol whose node is required
+	 * @return node associated with the symbol
+	 * @see TrieNode#getChildCreate(Object)
+	 */
+	protected TrieNode<T> getChildCreate(T symbol) {
 		return rootNode.getChildCreate(symbol);
 	}
-	
+
+	/**
+	 * <p>
+	 * Returns the child of the root node associated with the given symbol or
+	 * null if it does not exist.
+	 * </p>
+	 * 
+	 * @param symbol
+	 *            symbol whose node is required
+	 * @return node associated with the symbol; null if no such node exists
+	 * @see TrieNode#getChild(Object)
+	 */
 	protected TrieNode<T> getChild(T symbol) {
 		return rootNode.getChild(symbol);
 	}
 
-	// get the count of "sequence"
+	/**
+	 * <p>
+	 * Returns the number of occurences of the given sequence.
+	 * </p>
+	 * 
+	 * @param sequence
+	 *            sequence whose number of occurences is required
+	 * @return number of occurences of the sequence
+	 */
 	public int getCount(List<T> sequence) {
 		int count = 0;
 		TrieNode<T> node = find(sequence);
-		if( node!=null ) {
+		if (node != null) {
 			count = node.getCount();
 		}
 		return count;
 	}
-	
-	// get the count of "sequence,follower"
+
+	/**
+	 * <p>
+	 * Returns the number of occurences of the given prefix and a symbol that
+	 * follows it.<br>
+	 * Convenience function to simplify usage of {@link #getCount(List)}.
+	 * </p>
+	 * 
+	 * @param sequence
+	 *            prefix of the sequence
+	 * @param follower
+	 *            suffix of the sequence
+	 * @return number of occurences of the sequence
+	 * @see #getCount(List)
+	 */
 	public int getCount(List<T> sequence, T follower) {
 		List<T> tmpSequence = new LinkedList<T>(sequence);
 		tmpSequence.add(follower);
 		return getCount(tmpSequence);
-		
-	}
-	
+
+	}
+
+	/**
+	 * <p>
+	 * Searches the trie for a given sequence and returns the node associated
+	 * with the sequence or null if no such node is found.
+	 * </p>
+	 * 
+	 * @param sequence
+	 *            sequence that is searched for
+	 * @return node associated with the sequence
+	 * @see TrieNode#find(List)
+	 */
 	public TrieNode<T> find(List<T> sequence) {
-		if( sequence==null || sequence.isEmpty() ) {
+		if (sequence == null || sequence.isEmpty()) {
 			return rootNode;
 		}
@@ -96,5 +206,5 @@
 		TrieNode<T> result = null;
 		TrieNode<T> node = getChild(sequenceCopy.get(0));
-		if( node!=null ) {
+		if (node != null) {
 			sequenceCopy.remove(0);
 			result = node.find(sequenceCopy);
@@ -102,53 +212,119 @@
 		return result;
 	}
-	
-	// returns all symbols that follow the defined sequence
+
+	/**
+	 * <p>
+	 * Returns a collection of all symbols that follow a given sequence in the
+	 * trie. In case the sequence is not found or no symbols follow the sequence
+	 * the result will be empty.
+	 * </p>
+	 * 
+	 * @param sequence
+	 *            sequence whose followers are returned
+	 * @return symbols following the given sequence
+	 * @see TrieNode#getFollowingSymbols()
+	 */
 	public Collection<T> getFollowingSymbols(List<T> sequence) {
 		Collection<T> result = new LinkedList<T>();
 		TrieNode<T> node = find(sequence);
-		if( node!=null ) {
+		if (node != null) {
 			result = node.getFollowingSymbols();
 		}
 		return result;
 	}
-	
-	// longest suffix of context, that is contained in the tree and whose children are leaves
-	// possibly already deprecated
+
+	/**
+	 * <p>
+	 * Returns the longest suffix of the given context that is contained in the
+	 * tree and whose children are leaves.
+	 * </p>
+	 * 
+	 * @param context
+	 *            context whose suffix is searched for
+	 * @return longest suffix of the context
+	 */
 	public List<T> getContextSuffix(List<T> context) {
 		List<T> contextSuffix = new LinkedList<T>(context); // defensive copy
 		boolean suffixFound = false;
-		
-		while(!suffixFound) {
-			if( contextSuffix.isEmpty() ) {
+
+		while (!suffixFound) {
+			if (contextSuffix.isEmpty()) {
 				suffixFound = true; // suffix is the empty word
 			} else {
 				TrieNode<T> node = find(contextSuffix);
-				if( node!=null ) {
-					if( !node.getFollowingSymbols().isEmpty() ) {
+				if (node != null) {
+					if (!node.getFollowingSymbols().isEmpty()) {
 						suffixFound = true;
 					}
 				}
-				if( !suffixFound ) {
+				if (!suffixFound) {
 					contextSuffix.remove(0);
 				}
 			}
 		}
-		
+
 		return contextSuffix;
 	}
-	
-	
-	static public class Edge{}
-	
+
+	/**
+	 * <p>
+	 * Helper class for graph visualization of a trie.
+	 * </p>
+	 * 
+	 * @author Steffen Herbold
+	 * @version 1.0
+	 */
+	static public class Edge {
+	}
+
+	/**
+	 * <p>
+	 * Helper class for graph visualization of a trie.
+	 * </p>
+	 * 
+	 * @author Steffen Herbold
+	 * @version 1.0
+	 */
 	static public class TrieVertex {
+
+		/**
+		 * <p>
+		 * Id of the vertex.
+		 * </p>
+		 */
 		private String id;
+
+		/**
+		 * <p>
+		 * Contructor. Creates a new TrieVertex.
+		 * </p>
+		 * 
+		 * @param id
+		 *            id of the vertex
+		 */
 		protected TrieVertex(String id) {
 			this.id = id;
 		}
+
+		/**
+		 * <p>
+		 * Returns the id of the vertex.
+		 * </p>
+		 * 
+		 * @see java.lang.Object#toString()
+		 */
+		@Override
 		public String toString() {
 			return id;
 		}
 	}
-	
+
+	/**
+	 * <p>
+	 * Returns a {@link Graph} representation of the trie.
+	 * </p>
+	 * 
+	 * @return {@link Graph} representation of the trie
+	 */
 	protected Tree<TrieVertex, Edge> getGraph() {
 		DelegateTree<TrieVertex, Edge> graph = new DelegateTree<TrieVertex, Edge>();
@@ -156,5 +332,10 @@
 		return graph;
 	}
-	
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.eventbench.models.IDotCompatible#getDotRepresentation()
+	 */
 	public String getDotRepresentation() {
 		StringBuilder stringBuilder = new StringBuilder();
@@ -164,10 +345,25 @@
 		return stringBuilder.toString();
 	}
-	
+
+	/**
+	 * <p>
+	 * Returns the string representation of the root node.
+	 * </p>
+	 * 
+	 * @see TrieNode#toString()
+	 * @see java.lang.Object#toString()
+	 */
 	@Override
 	public String toString() {
 		return rootNode.toString();
 	}
-	
+
+	/**
+	 * <p>
+	 * Returns the number of symbols contained in the trie.
+	 * </p>
+	 * 
+	 * @return
+	 */
 	public int getNumSymbols() {
 		return knownSymbols.size();
Index: trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieNode.java
===================================================================
--- trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieNode.java	(revision 102)
+++ trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieNode.java	(revision 106)
@@ -11,18 +11,56 @@
 import de.ugoe.cs.util.StringTools;
 import edu.uci.ics.jung.graph.DelegateTree;
-
-
+import edu.uci.ics.jung.graph.Tree;
+
+/**
+ * <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 trie to this node.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * 
+ * @param <T>
+ *            Type of the symbols that are stored in the trie.
+ * @see Trie
+ */
 class TrieNode<T> implements Serializable {
-	
-	/**
+
+	/**
+	 * <p>
 	 * Id for object serialization.
+	 * </p>
 	 */
 	private static final long serialVersionUID = 1L;
-	
+
+	/**
+	 * <p>
+	 * Counter for the number of occurences of the sequence.
+	 * </p>
+	 */
 	private int count;
+
+	/**
+	 * <p>
+	 * Symbol associated with the node.
+	 * </p>
+	 */
 	private final T symbol;
-	
+
+	/**
+	 * <p>
+	 * Child nodes of this node. If the node is a leaf this collection is empty.
+	 * </p>
+	 */
 	private Collection<TrieNode<T>> children;
-	
+
+	/**
+	 * <p>
+	 * 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>
+	 * </p>
+	 */
 	TrieNode() {
 		this.symbol = null;
@@ -30,8 +68,17 @@
 		children = new LinkedList<TrieNode<T>>();
 	}
-	
+
+	/**
+	 * <p>
+	 * Constructor. Creates a new TrieNode. The symbol must not be null.
+	 * </p>
+	 * 
+	 * @param symbol
+	 *            symbol associated with the trie node
+	 */
 	public TrieNode(T symbol) {
-		if( symbol==null ) {
-			throw new InvalidParameterException("symbol must not be null. null is reserved for root node!");
+		if (symbol == null) {
+			throw new InvalidParameterException(
+					"symbol must not be null. null is reserved for root node!");
 		}
 		this.symbol = symbol;
@@ -40,12 +87,24 @@
 	}
 
+	/**
+	 * <p>
+	 * Adds a given subsequence to the trie and increases the counters
+	 * accordingly.
+	 * </p>
+	 * 
+	 * @param subsequence
+	 *            subsequence whose counters are increased
+	 * @see Trie#add(List)
+	 */
 	public void add(List<T> subsequence) {
-		if( !subsequence.isEmpty() ) {
-			if( !symbol.equals(subsequence.get(0)) ) { // should be guaranteed by the recursion/TrieRoot!
+		if (!subsequence.isEmpty()) {
+			if (!symbol.equals(subsequence.get(0))) { // should be guaranteed by
+														// the
+														// recursion/TrieRoot!
 				throw new AssertionError("Invalid trie operation!");
 			}
 			count++;
 			subsequence.remove(0);
-			if( !subsequence.isEmpty() ) {
+			if (!subsequence.isEmpty()) {
 				T nextSymbol = subsequence.get(0);
 				getChildCreate(nextSymbol).add(subsequence);
@@ -53,16 +112,41 @@
 		}
 	}
-	
+
+	/**
+	 * <p>
+	 * Returns the symbol associated with the node.
+	 * </p>
+	 * 
+	 * @return symbol associated with the node
+	 */
 	public T getSymbol() {
 		return symbol;
 	}
-	
+
+	/**
+	 * <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
+	 */
 	public int getCount() {
 		return count;
 	}
-	
-	protected TrieNode<T>  getChildCreate(T symbol) {
+
+	/**
+	 * <p>
+	 * Returns the child of the node associated with the given symbol or creates
+	 * it if it does not exist yet.
+	 * </p>
+	 * 
+	 * @param symbol
+	 *            symbol whose node is required
+	 * @return node associated with the symbol
+	 * @see Trie#getChildCreate(Object)
+	 */
+	protected TrieNode<T> getChildCreate(T symbol) {
 		TrieNode<T> node = getChild(symbol);
-		if( node==null ) {
+		if (node == null) {
 			node = new TrieNode<T>(symbol);
 			children.add(node);
@@ -70,8 +154,19 @@
 		return node;
 	}
-	
+
+	/**
+	 * <p>
+	 * Returns the child of the node associated with the given symbol or null if
+	 * it does not exist.
+	 * </p>
+	 * 
+	 * @param symbol
+	 *            symbol whose node is required
+	 * @return node associated with the symbol; null if no such node exists
+	 * @see Trie#getChild(Object)
+	 */
 	protected TrieNode<T> getChild(T symbol) {
-		for( TrieNode<T> child : children ) {
-			if( child.getSymbol().equals(symbol) ) {
+		for (TrieNode<T> child : children) {
+			if (child.getSymbol().equals(symbol)) {
 				return child;
 			}
@@ -79,14 +174,23 @@
 		return null;
 	}
-	
-
-	
+
+	/**
+	 * <p>
+	 * Searches the sub-trie of this trie node for a given sequence and returns
+	 * the node associated with the sequence or null if no such node is found.
+	 * </p>
+	 * 
+	 * @param sequence
+	 *            sequence that is searched for
+	 * @return node associated with the sequence
+	 * @see Trie#find(List)
+	 */
 	public TrieNode<T> find(List<T> subsequence) {
 		TrieNode<T> result = null;
-		if( subsequence.isEmpty() ) {
+		if (subsequence.isEmpty()) {
 			result = this;
 		} else {
 			TrieNode<T> node = getChild(subsequence.get(0));
-			if( node!=null ) {
+			if (node != null) {
 				subsequence.remove(0);
 				result = node.find(subsequence);
@@ -95,49 +199,88 @@
 		return result;
 	}
-	
-	// returns all symbols that follow this node
+
+	/**
+	 * <p>
+	 * Returns a collection of all symbols that follow a this node, i.e., the
+	 * symbols associated with the children of this node.
+	 * </p>
+	 * 
+	 * @return symbols follow this node
+	 * @see TrieNode#getFollowingSymbols()
+	 */
 	public Collection<T> getFollowingSymbols() {
 		Collection<T> followingSymbols = new LinkedList<T>();
-		for( TrieNode<T> child : children ) {
+		for (TrieNode<T> child : children) {
 			followingSymbols.add(child.getSymbol());
 		}
 		return followingSymbols;
 	}
-	
+
+	/**
+	 * <p>
+	 * The string representation of a node is {@code symbol.toString()#count}
+	 * </p>
+	 * 
+	 * @see java.lang.Object#toString()
+	 */
 	@Override
 	public String toString() {
-		String str = symbol.toString()+" #"+count;
-		if( !children.isEmpty() ) {
+		String str = symbol.toString() + " #" + count;
+		if (!children.isEmpty()) {
 			str += StringTools.ENDLINE + children.toString();
 		}
-		return str; 
-	}
-
-	public void getGraph(TrieVertex parent, DelegateTree<TrieVertex, Edge> graph) {
+		return str;
+	}
+
+	/**
+	 * <p>
+	 * Generates a {@link Tree} represenation of the trie.
+	 * </p>
+	 * 
+	 * @param parent
+	 *            parent vertex in the generated tree
+	 * @param graph
+	 *            complete tree
+	 */
+	void getGraph(TrieVertex parent, DelegateTree<TrieVertex, Edge> graph) {
 		TrieVertex currentVertex;
-		if( symbol==null ){
+		if (symbol == null) {
 			currentVertex = new TrieVertex("root");
 			graph.addVertex(currentVertex);
 		} else {
-			currentVertex = new TrieVertex(getSymbol().toString()+"#"+getCount());
-			graph.addChild( new Edge() , parent, currentVertex );
-		}
-		for( TrieNode<T> node : children ) {
+			currentVertex = new TrieVertex(getSymbol().toString() + "#"
+					+ getCount());
+			graph.addChild(new Edge(), parent, currentVertex);
+		}
+		for (TrieNode<T> node : children) {
 			node.getGraph(currentVertex, graph);
-		}		
-	}
-	
+		}
+	}
+
+	/**
+	 * <p>
+	 * Appends the current node to the dot representation of the trie.
+	 * </p>
+	 * 
+	 * @param stringBuilder
+	 *            {@link StringBuilder} to which the dot representation is
+	 *            appended
+	 */
 	void appendDotRepresentation(StringBuilder stringBuilder) {
 		String thisSaneId;
-		if( symbol==null ) {
+		if (symbol == null) {
 			thisSaneId = "root";
 		} else {
-			thisSaneId = symbol.toString().replace("\"", "\\\"").replaceAll("[\r\n]","")+"#"+count;
-		}
-		stringBuilder.append(" " + hashCode() + " [label=\""+thisSaneId+"\"];" + StringTools.ENDLINE);
-		for( TrieNode<T> childNode : children ) {
-			stringBuilder.append(" "+hashCode()+" -> " + childNode.hashCode() + ";" + StringTools.ENDLINE);
-		}
-		for( TrieNode<T> childNode : children ) {
+			thisSaneId = symbol.toString().replace("\"", "\\\"")
+					.replaceAll("[\r\n]", "")
+					+ "#" + count;
+		}
+		stringBuilder.append(" " + hashCode() + " [label=\"" + thisSaneId
+				+ "\"];" + StringTools.ENDLINE);
+		for (TrieNode<T> childNode : children) {
+			stringBuilder.append(" " + hashCode() + " -> "
+					+ childNode.hashCode() + ";" + StringTools.ENDLINE);
+		}
+		for (TrieNode<T> childNode : children) {
 			childNode.appendDotRepresentation(stringBuilder);
 		}
