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

Last change on this file since 2042 was 2042, checked in by pharms, 9 years ago
  • finalized smell detection for phd thesis
File size: 2.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;
16
17import java.util.ArrayList;
18import java.util.Collection;
19import java.util.List;
20import java.util.Map;
21
22import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
23import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
24
25/**
26 * TODO comment
27 *
28 * @version $Revision: $ $Date: 16.07.2012$
29 * @author 2012, last modified by $Author: pharms$
30 */
31public class UsabilityEvaluationResult {
32   
33    /** */
34    private ITaskModel taskModel;
35   
36    /** */
37    private List<UsabilitySmell> smells = new ArrayList<UsabilitySmell>();
38
39    /**
40     *
41     */
42    public UsabilityEvaluationResult(ITaskModel taskModel) {
43        this.taskModel = taskModel;
44    }
45
46    /**
47     *
48     */
49    public UsabilityEvaluationResult(ITaskModel                 taskModel,
50                                     Collection<UsabilitySmell> smells)
51    {
52        this.taskModel = taskModel;
53        for (UsabilitySmell smell : smells) {
54            this.smells.add(smell);
55        }
56    }
57
58    /**
59     *
60     */
61    public UsabilityEvaluationResult(ITaskModel                      taskModel,
62                                     List<UsabilityEvaluationResult> results)
63    {
64        this.taskModel = taskModel;
65        for (UsabilityEvaluationResult result : results) {
66            for (UsabilitySmell smell : result.getAllSmells()) {
67                smells.add(smell);
68            }
69        }
70    }
71
72    /**
73     *
74     */
75    public void addSmell(UsabilitySmellIntensity   intensity,
76                         UsabilitySmellDescription description,
77                         Map<String, Object>       parameters)
78    {
79        addSmell(null, intensity, description, parameters);
80    }
81
82    /**
83     *
84     */
85    public void addSmell(ITask                     smellingTask,
86                         UsabilitySmellIntensity   intensity,
87                         UsabilitySmellDescription description,
88                         Map<String, Object>       parameters)
89    {
90        smells.add(new UsabilitySmell(smellingTask, intensity, description, parameters));
91    }
92
93    /**
94     *
95     */
96    public List<UsabilitySmell> getAllSmells() {
97        return smells;
98    }
99
100    /**
101     * @return the taskModel
102     */
103    public ITaskModel getTaskModel() {
104        return taskModel;
105    }
106
107}
Note: See TracBrowser for help on using the repository browser.