source: trunk/autoquest-plugin-usability2/src/main/java/de/ugoe/cs/autoquest/usability/EvaluationMethodCaller.java @ 1326

Last change on this file since 1326 was 1217, checked in by adeicke, 11 years ago
  • Added proper formating and JavaDoc?.
  • Several renaming refactorings.
  • Property svn:mime-type set to text/plain
File size: 2.0 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 com.google.common.base.Optional;
18
19import de.ugoe.cs.autoquest.usability.result.UsabilityProblemDescription;
20import de.ugoe.cs.autoquest.usability.rules.UsabilityMetric;
21import de.ugoe.cs.autoquest.usability.rules.UsabilityUsageProblem;
22
23/**
24 * <p>
25 * Helper class, which calls the evaluation method depending on the type of the usability rule.
26 * </p>
27 *
28 * @author Alexander Deicke
29 */
30public class EvaluationMethodCaller {
31
32    /**
33     *
34     * <p>
35     * Calls evaluation method of a usability metric.
36     * </p>
37     *
38     * @param metric
39     *            on which evaluation method should be called
40     * @return description of metric/defect, iff metric exceeds predefined threshold
41     */
42    public Optional<UsabilityProblemDescription> check(UsabilityMetric metric) {
43        return metric.calculate();
44    }
45
46    /**
47     *
48     * <p>
49     * Calls evaluation method of a usability usage defect.
50     * </p>
51     *
52     * @param usageDefect
53     *            on which evaluation method should be called
54     * @return description of usage defect, iff it was detected during the usability evaluation
55     */
56    public Optional<UsabilityProblemDescription> check(UsabilityUsageProblem usageDefect) {
57        return usageDefect.check();
58    }
59}
Note: See TracBrowser for help on using the repository browser.