Changeset 1135 for trunk/autoquest-core-usability-evaluation
- Timestamp:
- 03/27/13 14:10:02 (12 years ago)
- Location:
- trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree
- Files:
-
- 4 deleted
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/FilterResult.java
r1040 r1135 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.usability.tasktree .filter;15 package de.ugoe.cs.autoquest.usability.tasktree; 16 16 17 17 import java.util.List; 18 18 19 19 import com.google.common.base.Predicate; 20 import com.google.common.collect.LinkedListMultimap;21 20 import com.google.common.collect.Lists; 22 import com.google.common.collect.Multimap;23 21 24 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;25 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask;26 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 27 23 … … 33 29 * @author Alexander Deicke 34 30 */ 35 public class Filter Statistic{31 public class FilterResult { 36 32 37 33 @SuppressWarnings("rawtypes") … … 43 39 44 40 @SuppressWarnings("rawtypes") 45 public Filter Statistic(Predicate filterPredicate) {41 public FilterResult(Predicate filterPredicate) { 46 42 this.filterPredicate = filterPredicate; 47 43 } … … 73 69 } 74 70 75 /**76 * <p>77 * TODO: comment78 * </p>79 *80 * @param eventTargetParent81 * @return82 */83 public Multimap<IGUIElement, ITaskTreeNode> groupBy() {84 Multimap<IGUIElement, ITaskTreeNode> groupedNodes = LinkedListMultimap.create();85 for(ITaskTreeNode node : filteredNodes) {86 IGUIElement eventTask = (IGUIElement) ((IEventTask) node).getEventTarget();87 groupedNodes.put(eventTask.getParent(), node);88 }89 return groupedNodes;90 }91 92 71 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/IterativeDFSFilterStrategy.java
r1040 r1135 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.usability.tasktree .filter;15 package de.ugoe.cs.autoquest.usability.tasktree; 16 16 17 import java.util.Stack; 17 import java.util.LinkedList; 18 import java.util.Queue; 18 19 19 20 import com.google.common.base.Predicate; … … 23 24 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 24 25 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 26 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTargetFilter; 27 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 28 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter; 25 29 26 30 /** … … 33 37 public class IterativeDFSFilterStrategy implements TaskTreeFilterStrategy { 34 38 35 private Filter StatisticfilterStatistic;39 private FilterResult filterStatistic; 36 40 37 41 @SuppressWarnings("unchecked") 38 42 @Override 39 public Filter Statisticfilter(ITaskTree taskTree, EventTargetFilter eventTarget) {43 public FilterResult filter(ITaskTree taskTree, EventTargetFilter eventTarget) { 40 44 Predicate<IEventTarget> filterPredicate = eventTarget.filterPredicate(); 41 this.filterStatistic = new Filter Statistic(filterPredicate);45 this.filterStatistic = new FilterResult(filterPredicate); 42 46 traverse(taskTree); 43 47 return this.filterStatistic; … … 46 50 @SuppressWarnings("unchecked") 47 51 @Override 48 public Filter Statisticfilter(ITaskTree taskTree, EventTypeFilter eventType) {52 public FilterResult filter(ITaskTree taskTree, EventTypeFilter eventType) { 49 53 Predicate<IEventType> filterPredicate = eventType.filterPredicate(); 50 this.filterStatistic = new Filter Statistic(filterPredicate);54 this.filterStatistic = new FilterResult(filterPredicate); 51 55 traverse(taskTree); 52 56 return this.filterStatistic; … … 55 59 @SuppressWarnings("unchecked") 56 60 @Override 57 public Filter Statisticfilter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType) {61 public FilterResult filter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType) { 58 62 Predicate<ITaskTreeNode> filterPredicate = nodeType.filterPredicate(); 59 this.filterStatistic = new Filter Statistic(filterPredicate);63 this.filterStatistic = new FilterResult(filterPredicate); 60 64 traverse(taskTree); 61 65 return this.filterStatistic; … … 63 67 64 68 private void traverse(ITaskTree taskTree) { 65 Stack<ITaskTreeNode> unvisitedNodes = new Stack<ITaskTreeNode>();66 unvisitedNodes. push(taskTree.getRoot());69 Queue<ITaskTreeNode> unvisitedNodes = new LinkedList<ITaskTreeNode>(); 70 unvisitedNodes.add(taskTree.getRoot()); 67 71 while (stillUnvisitedNodes(unvisitedNodes)) { 68 ITaskTreeNode node = unvisitedNodes.po p();72 ITaskTreeNode node = unvisitedNodes.poll(); 69 73 processCurrentNode(node); 70 74 processChildrenOfCurrentNode(unvisitedNodes, node); … … 72 76 } 73 77 74 private boolean stillUnvisitedNodes( Stack<ITaskTreeNode> unvisitedNodes) {78 private boolean stillUnvisitedNodes(Queue<ITaskTreeNode> unvisitedNodes) { 75 79 return !unvisitedNodes.isEmpty(); 76 80 } … … 80 84 } 81 85 82 private void processChildrenOfCurrentNode( Stack<ITaskTreeNode> unvisitedNodes,86 private void processChildrenOfCurrentNode(Queue<ITaskTreeNode> unvisitedNodes, 83 87 ITaskTreeNode node) 84 88 { 85 89 for (ITaskTreeNode child : node.getChildren()) { 86 unvisitedNodes. push(child);90 unvisitedNodes.add(child); 87 91 } 88 92 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/TaskTreeFilterStrategy.java
r1040 r1135 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.usability.tasktree .filter;15 package de.ugoe.cs.autoquest.usability.tasktree; 16 16 17 17 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 18 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTargetFilter; 19 import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 20 import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter; 18 21 19 22 /** … … 26 29 public interface TaskTreeFilterStrategy { 27 30 28 public Filter Statisticfilter(ITaskTree taskTree, EventTargetFilter eventTarget);31 public FilterResult filter(ITaskTree taskTree, EventTargetFilter eventTarget); 29 32 30 public Filter Statisticfilter(ITaskTree taskTree, EventTypeFilter eventType);33 public FilterResult filter(ITaskTree taskTree, EventTypeFilter eventType); 31 34 32 public Filter Statisticfilter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType);35 public FilterResult filter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType); 33 36 34 37 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/EventTargetFilter.java
r1040 r1135 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.usability.tasktree.filter ;15 package de.ugoe.cs.autoquest.usability.tasktree.filters; 16 16 17 17 import com.google.common.base.Function; -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/EventTypeFilter.java
r1040 r1135 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.usability.tasktree.filter ;15 package de.ugoe.cs.autoquest.usability.tasktree.filters; 16 16 17 17 import com.google.common.base.Function; -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/TaskTreeFilter.java
r1040 r1135 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.usability.tasktree.filter ;15 package de.ugoe.cs.autoquest.usability.tasktree.filters; 16 16 17 17 import com.google.common.base.Preconditions; 18 18 19 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 20 import de.ugoe.cs.autoquest.usability.tasktree.FilterResult; 21 import de.ugoe.cs.autoquest.usability.tasktree.TaskTreeFilterStrategy; 20 22 21 23 /** … … 55 57 } 56 58 57 public Filter Statisticfrom(ITaskTree taskTree) {59 public FilterResult from(ITaskTree taskTree) { 58 60 return taskTreeFilterStrategy.filter(taskTree, eventTarget); 59 61 } … … 69 71 } 70 72 71 public Filter Statisticfrom(ITaskTree taskTree) {73 public FilterResult from(ITaskTree taskTree) { 72 74 return taskTreeFilterStrategy.filter(taskTree, eventType); 73 75 } … … 83 85 } 84 86 85 public Filter Statisticfrom(ITaskTree taskTree) {87 public FilterResult from(ITaskTree taskTree) { 86 88 return taskTreeFilterStrategy.filter(taskTree, nodeType); 87 89 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/TaskTreeNodeFilter.java
r1040 r1135 13 13 // limitations under the License. 14 14 15 package de.ugoe.cs.autoquest.usability.tasktree.filter ;15 package de.ugoe.cs.autoquest.usability.tasktree.filters; 16 16 17 17 import com.google.common.base.Predicate;
Note: See TracChangeset
for help on using the changeset viewer.