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 | |
---|
15 | package de.ugoe.cs.autoquest.usability; |
---|
16 | |
---|
17 | import java.util.ArrayList; |
---|
18 | import java.util.List; |
---|
19 | import java.util.Map; |
---|
20 | |
---|
21 | import 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 | */ |
---|
29 | public 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 | } |
---|