Ignore:
Timestamp:
03/27/13 14:10:02 (12 years ago)
Author:
adeicke
Message:

Restructuring of package structure.

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  
    1313//   limitations under the License. 
    1414 
    15 package de.ugoe.cs.autoquest.usability.tasktree.filter; 
     15package de.ugoe.cs.autoquest.usability.tasktree; 
    1616 
    1717import java.util.List; 
    1818 
    1919import com.google.common.base.Predicate; 
    20 import com.google.common.collect.LinkedListMultimap; 
    2120import com.google.common.collect.Lists; 
    22 import com.google.common.collect.Multimap; 
    2321 
    24 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement; 
    25 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 
    2622import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
    2723 
     
    3329 * @author Alexander Deicke 
    3430 */ 
    35 public class FilterStatistic { 
     31public class FilterResult { 
    3632 
    3733    @SuppressWarnings("rawtypes") 
     
    4339 
    4440    @SuppressWarnings("rawtypes") 
    45     public FilterStatistic(Predicate filterPredicate) { 
     41    public FilterResult(Predicate filterPredicate) { 
    4642        this.filterPredicate = filterPredicate; 
    4743    } 
     
    7369    } 
    7470 
    75     /** 
    76      * <p> 
    77      * TODO: comment 
    78      * </p> 
    79      * 
    80      * @param eventTargetParent 
    81      * @return 
    82      */ 
    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  
    9271} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/IterativeDFSFilterStrategy.java

    r1040 r1135  
    1313//   limitations under the License. 
    1414 
    15 package de.ugoe.cs.autoquest.usability.tasktree.filter; 
     15package de.ugoe.cs.autoquest.usability.tasktree; 
    1616 
    17 import java.util.Stack; 
     17import java.util.LinkedList; 
     18import java.util.Queue; 
    1819 
    1920import com.google.common.base.Predicate; 
     
    2324import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 
    2425import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode; 
     26import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTargetFilter; 
     27import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 
     28import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter; 
    2529 
    2630/** 
     
    3337public class IterativeDFSFilterStrategy implements TaskTreeFilterStrategy { 
    3438 
    35     private FilterStatistic filterStatistic; 
     39    private FilterResult filterStatistic; 
    3640 
    3741    @SuppressWarnings("unchecked") 
    3842    @Override 
    39     public FilterStatistic filter(ITaskTree taskTree, EventTargetFilter eventTarget) { 
     43    public FilterResult filter(ITaskTree taskTree, EventTargetFilter eventTarget) { 
    4044        Predicate<IEventTarget> filterPredicate = eventTarget.filterPredicate(); 
    41         this.filterStatistic = new FilterStatistic(filterPredicate); 
     45        this.filterStatistic = new FilterResult(filterPredicate); 
    4246        traverse(taskTree); 
    4347        return this.filterStatistic; 
     
    4650    @SuppressWarnings("unchecked") 
    4751    @Override 
    48     public FilterStatistic filter(ITaskTree taskTree, EventTypeFilter eventType) { 
     52    public FilterResult filter(ITaskTree taskTree, EventTypeFilter eventType) { 
    4953        Predicate<IEventType> filterPredicate = eventType.filterPredicate(); 
    50         this.filterStatistic = new FilterStatistic(filterPredicate); 
     54        this.filterStatistic = new FilterResult(filterPredicate); 
    5155        traverse(taskTree); 
    5256        return this.filterStatistic; 
     
    5559    @SuppressWarnings("unchecked") 
    5660    @Override 
    57     public FilterStatistic filter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType) { 
     61    public FilterResult filter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType) { 
    5862        Predicate<ITaskTreeNode> filterPredicate = nodeType.filterPredicate(); 
    59         this.filterStatistic = new FilterStatistic(filterPredicate); 
     63        this.filterStatistic = new FilterResult(filterPredicate); 
    6064        traverse(taskTree); 
    6165        return this.filterStatistic; 
     
    6367 
    6468    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()); 
    6771        while (stillUnvisitedNodes(unvisitedNodes)) { 
    68             ITaskTreeNode node = unvisitedNodes.pop(); 
     72            ITaskTreeNode node = unvisitedNodes.poll(); 
    6973            processCurrentNode(node); 
    7074            processChildrenOfCurrentNode(unvisitedNodes, node); 
     
    7276    } 
    7377 
    74     private boolean stillUnvisitedNodes(Stack<ITaskTreeNode> unvisitedNodes) { 
     78    private boolean stillUnvisitedNodes(Queue<ITaskTreeNode> unvisitedNodes) { 
    7579        return !unvisitedNodes.isEmpty(); 
    7680    } 
     
    8084    } 
    8185 
    82     private void processChildrenOfCurrentNode(Stack<ITaskTreeNode> unvisitedNodes, 
     86    private void processChildrenOfCurrentNode(Queue<ITaskTreeNode> unvisitedNodes, 
    8387                                              ITaskTreeNode node) 
    8488    { 
    8589        for (ITaskTreeNode child : node.getChildren()) { 
    86             unvisitedNodes.push(child); 
     90            unvisitedNodes.add(child); 
    8791        } 
    8892    } 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/TaskTreeFilterStrategy.java

    r1040 r1135  
    1313//   limitations under the License. 
    1414 
    15 package de.ugoe.cs.autoquest.usability.tasktree.filter; 
     15package de.ugoe.cs.autoquest.usability.tasktree; 
    1616 
    1717import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 
     18import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTargetFilter; 
     19import de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter; 
     20import de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter; 
    1821 
    1922/** 
     
    2629public interface TaskTreeFilterStrategy { 
    2730 
    28     public FilterStatistic filter(ITaskTree taskTree, EventTargetFilter eventTarget); 
     31    public FilterResult filter(ITaskTree taskTree, EventTargetFilter eventTarget); 
    2932 
    30     public FilterStatistic filter(ITaskTree taskTree, EventTypeFilter eventType); 
     33    public FilterResult filter(ITaskTree taskTree, EventTypeFilter eventType); 
    3134 
    32     public FilterStatistic filter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType); 
     35    public FilterResult filter(ITaskTree taskTree, TaskTreeNodeTypeFilter nodeType); 
    3336 
    3437} 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/EventTargetFilter.java

    r1040 r1135  
    1313//   limitations under the License. 
    1414 
    15 package de.ugoe.cs.autoquest.usability.tasktree.filter; 
     15package de.ugoe.cs.autoquest.usability.tasktree.filters; 
    1616 
    1717import com.google.common.base.Function; 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/EventTypeFilter.java

    r1040 r1135  
    1313//   limitations under the License. 
    1414 
    15 package de.ugoe.cs.autoquest.usability.tasktree.filter; 
     15package de.ugoe.cs.autoquest.usability.tasktree.filters; 
    1616 
    1717import com.google.common.base.Function; 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/TaskTreeFilter.java

    r1040 r1135  
    1313//   limitations under the License. 
    1414 
    15 package de.ugoe.cs.autoquest.usability.tasktree.filter; 
     15package de.ugoe.cs.autoquest.usability.tasktree.filters; 
    1616 
    1717import com.google.common.base.Preconditions; 
    1818 
    1919import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree; 
     20import de.ugoe.cs.autoquest.usability.tasktree.FilterResult; 
     21import de.ugoe.cs.autoquest.usability.tasktree.TaskTreeFilterStrategy; 
    2022 
    2123/** 
     
    5557        } 
    5658 
    57         public FilterStatistic from(ITaskTree taskTree) { 
     59        public FilterResult from(ITaskTree taskTree) { 
    5860            return taskTreeFilterStrategy.filter(taskTree, eventTarget); 
    5961        } 
     
    6971        } 
    7072 
    71         public FilterStatistic from(ITaskTree taskTree) { 
     73        public FilterResult from(ITaskTree taskTree) { 
    7274            return taskTreeFilterStrategy.filter(taskTree, eventType); 
    7375        } 
     
    8385        } 
    8486 
    85         public FilterStatistic from(ITaskTree taskTree) { 
     87        public FilterResult from(ITaskTree taskTree) { 
    8688            return taskTreeFilterStrategy.filter(taskTree, nodeType); 
    8789        } 
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/filters/TaskTreeNodeFilter.java

    r1040 r1135  
    1313//   limitations under the License. 
    1414 
    15 package de.ugoe.cs.autoquest.usability.tasktree.filter; 
     15package de.ugoe.cs.autoquest.usability.tasktree.filters; 
    1616 
    1717import com.google.common.base.Predicate; 
Note: See TracChangeset for help on using the changeset viewer.