Index: trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/taskmodel/filter/TaskModelFilter.java
===================================================================
--- trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/taskmodel/filter/IterativeDFSFilterStrategy.java	(revision 1217)
+++ trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/taskmodel/filter/TaskModelFilter.java	(revision 1290)
@@ -15,13 +15,8 @@
 package de.ugoe.cs.autoquest.usability.taskmodel.filter;
 
-import java.util.LinkedList;
-import java.util.Queue;
-
 import com.google.common.base.Predicate;
 
 import de.ugoe.cs.autoquest.eventcore.IEventTarget;
 import de.ugoe.cs.autoquest.eventcore.IEventType;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.IMarkingTemporalRelationship;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship;
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
@@ -37,63 +32,45 @@
  * @author Alexander Deicke
  */
-public class IterativeDFSFilterStrategy implements TaskModelFilterStrategy {
+public class TaskModelFilter implements ITaskModelFilter {
 
-    private FilterResult filterStatistic;
+	private BFSTaskModelIterator taskModelIterator;
 
-    @SuppressWarnings("unchecked")
-    @Override
-    public FilterResult filter(ITaskModel taskModel, EventTargetFilter eventTarget) {
-        Predicate<IEventTarget> filterPredicate = eventTarget.filterPredicate();
-        this.filterStatistic = new FilterResult(filterPredicate);
-        traverse(taskModel);
-        return this.filterStatistic;
-    }
+	private FilterResult filterStatistic;
 
-    @SuppressWarnings("unchecked")
-    @Override
-    public FilterResult filter(ITaskModel taskModel, EventTypeFilter eventType) {
-        Predicate<IEventType> filterPredicate = eventType.filterPredicate();
-        this.filterStatistic = new FilterResult(filterPredicate);
-        traverse(taskModel);
-        return this.filterStatistic;
-    }
+	@SuppressWarnings("unchecked")
+	@Override
+	public FilterResult filter(ITaskModel taskModel,
+			EventTargetFilter eventTarget) {
+		Predicate<IEventTarget> filterPredicate = eventTarget.filterPredicate();
+		return setup(taskModel, filterPredicate);
+	}
 
-    @SuppressWarnings("unchecked")
-    @Override
-    public FilterResult filter(ITaskModel taskModel, TaskTypeFilter nodeType) {
-        Predicate<ITask> filterPredicate = nodeType.filterPredicate();
-        this.filterStatistic = new FilterResult(filterPredicate);
-        traverse(taskModel);
-        return this.filterStatistic;
-    }
+	@SuppressWarnings("unchecked")
+	@Override
+	public FilterResult filter(ITaskModel taskModel, EventTypeFilter eventType) {
+		Predicate<IEventType> filterPredicate = eventType.filterPredicate();
+		return setup(taskModel, filterPredicate);
+	}
 
-    private void traverse(ITaskModel taskModel) {
-        Queue<ITask> unvisitedTasks = new LinkedList<ITask>();
-        unvisitedTasks.addAll(taskModel.getTasks());
-        while (stillUnvisitedTasks(unvisitedTasks)) {
-            ITask task = unvisitedTasks.poll();
-            processCurrentTask(task);
-            processChildrenOfCurrentTask(unvisitedTasks, task);
-        }
-    }
+	@SuppressWarnings("unchecked")
+	@Override
+	public FilterResult filter(ITaskModel taskModel, TaskTypeFilter nodeType) {
+		Predicate<ITask> filterPredicate = nodeType.filterPredicate();
+		return setup(taskModel, filterPredicate);
+	}
 
-    private boolean stillUnvisitedTasks(Queue<ITask> unvisitedTasks) {
-        return !unvisitedTasks.isEmpty();
-    }
+	private FilterResult setup(ITaskModel taskModel,
+			Predicate<?> filterPredicate) {
+		this.filterStatistic = new FilterResult(filterPredicate);
+		this.taskModelIterator = BFSTaskModelIterator.iterator(taskModel);
+		traverse(taskModel);
+		return this.filterStatistic;
+	}
 
-    private void processCurrentTask(ITask task) {
-        this.filterStatistic.addTask(task);
-    }
-
-    private void processChildrenOfCurrentTask(Queue<ITask> unvisitedTasks, ITask task) {
-        if (task instanceof IStructuringTemporalRelationship) {
-            for (ITask child : ((IStructuringTemporalRelationship) task).getChildren()) {
-                unvisitedTasks.add(child);
-            }
-        }
-        else if (task instanceof IMarkingTemporalRelationship) {
-            unvisitedTasks.add(((IMarkingTemporalRelationship) task).getMarkedTask());
-        }
-    }
-
+	private void traverse(ITaskModel taskModel) {
+		while (this.taskModelIterator.hasNext()) {
+			ITask task = this.taskModelIterator.next();
+			this.filterStatistic.addTask(task);
+		}
+	}
 }
