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
RevLine 
[927]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
[922]15package de.ugoe.cs.autoquest.usability;
[442]16
17import java.util.ArrayList;
18import java.util.List;
[1335]19import java.util.Map;
[442]20
[1493]21import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
22
[442]23/**
24 * TODO comment
25 *
26 * @version $Revision: $ $Date: 16.07.2012$
27 * @author 2012, last modified by $Author: pharms$
28 */
[561]29public class UsabilityEvaluationResult {
30   
31    /** */
[1493]32    private ITaskModel taskModel;
33   
34    /** */
[561]35    private List<UsabilityDefect> defects = new ArrayList<UsabilityDefect>();
[442]36
[561]37    /**
[1301]38     *
[561]39     */
[1493]40    public UsabilityEvaluationResult(ITaskModel taskModel) {
41        this.taskModel = taskModel;
[561]42    }
[442]43
[561]44    /**
[1301]45     *
[561]46     */
[1493]47    public UsabilityEvaluationResult(ITaskModel                      taskModel,
48                                     List<UsabilityEvaluationResult> results)
49    {
50        this.taskModel = taskModel;
[1335]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,
[1493]63                          Map<String, Object>        parameters)
[1335]64    {
65        defects.add(new UsabilityDefect(severity, description, parameters));
66    }
67
68    /**
69     *
70     */
[561]71    public List<UsabilityDefect> getAllDefects() {
72        return defects;
73    }
[442]74
[561]75    /**
[1301]76     *
[561]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;
[442]88    }
89
[1493]90    /**
91     * @return the taskModel
92     */
93    public ITaskModel getTaskModel() {
94        return taskModel;
95    }
96
[442]97}
Note: See TracBrowser for help on using the repository browser.