source: trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityEvaluationResult.java @ 1493

Last change on this file since 1493 was 1493, checked in by pharms, 10 years ago
  • state of the HCSE 2014 Paper. An appropriate tag will follow.
File size: 2.5 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;
16
17import java.util.ArrayList;
18import java.util.List;
19import java.util.Map;
20
21import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
22
23/**
24 * TODO comment
25 *
26 * @version $Revision: $ $Date: 16.07.2012$
27 * @author 2012, last modified by $Author: pharms$
28 */
29public class UsabilityEvaluationResult {
30   
31    /** */
32    private ITaskModel taskModel;
33   
34    /** */
35    private List<UsabilityDefect> defects = new ArrayList<UsabilityDefect>();
36
37    /**
38     *
39     */
40    public UsabilityEvaluationResult(ITaskModel taskModel) {
41        this.taskModel = taskModel;
42    }
43
44    /**
45     *
46     */
47    public UsabilityEvaluationResult(ITaskModel                      taskModel,
48                                     List<UsabilityEvaluationResult> results)
49    {
50        this.taskModel = taskModel;
51        for (UsabilityEvaluationResult result : results) {
52            for (UsabilityDefect defect : result.getAllDefects()) {
53                defects.add(defect);
54            }
55        }
56    }
57
58    /**
59     *
60     */
61    public void addDefect(UsabilityDefectSeverity    severity,
62                          UsabilityDefectDescription description,
63                          Map<String, Object>        parameters)
64    {
65        defects.add(new UsabilityDefect(severity, description, parameters));
66    }
67
68    /**
69     *
70     */
71    public List<UsabilityDefect> getAllDefects() {
72        return defects;
73    }
74
75    /**
76     *
77     */
78    public List<UsabilityDefect> getSevereDefects() {
79        List<UsabilityDefect> severeDefects = new ArrayList<UsabilityDefect>();
80
81        for (UsabilityDefect defect : defects) {
82            if (defect.getSeverity() == UsabilityDefectSeverity.HIGH) {
83                severeDefects.add(defect);
84            }
85        }
86
87        return severeDefects;
88    }
89
90    /**
91     * @return the taskModel
92     */
93    public ITaskModel getTaskModel() {
94        return taskModel;
95    }
96
97}
Note: See TracBrowser for help on using the repository browser.