source: trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util/PatternsVisitorUtil.java @ 1164

Last change on this file since 1164 was 1164, checked in by adeicke, 11 years ago

Adjustments due to change from TaskTree? to TaskModel?.

  • Property svn:mime-type set to text/plain
File size: 1.9 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.usability.util;
16
17import java.util.List;
18
19import com.google.common.collect.Iterables;
20
21import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
22import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
23import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession;
24import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory;
25
26/**
27 * <p>
28 * TODO comment
29 * </p>
30 *
31 * @author Alexander Deicke
32 */
33public class PatternsVisitorUtil {
34
35    private PatternsVisitorUtil() {
36        // no instantiation
37    }
38   
39    /**
40     * <p>
41     * TODO: comment
42     * </p>
43     *
44     * @param taskTreeNode
45     * @return
46     */
47    public static ITaskModel createTaskModelFromUserSessions(List<IUserSession> userSessions) {
48        return new TaskFactory().createTaskModel(userSessions);
49    }
50   
51    /**
52     * <p>
53     * TODO: comment
54     * </p>
55     *
56     * @param taskTreeNodes
57     * @return
58     */
59    public static ITask firstNodeOf(List<ITask> tasks) {
60        return Iterables.getFirst(tasks, new NullTask());
61    }
62
63    /**
64     * <p>
65     * TODO: comment
66     * </p>
67     *
68     * @param taskTreeNodes
69     * @return
70     */
71    public static ITask lastNodeOf(List<ITask> tasks) {
72        return Iterables.getLast(tasks, new NullTask());
73    }
74   
75}
Note: See TracBrowser for help on using the repository browser.