source: autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/evaluation/rule/set/TextInputUsabiliyRuleset.java @ 1034

Last change on this file since 1034 was 1034, checked in by adeicke, 11 years ago

Renamed getRulesetForUsabilityEvaluation method to evaluationRules

  • Property svn:mime-type set to text/plain
File size: 2.2 KB
Line 
1
2package de.ugoe.cs.autoquest.usability.evaluation.rule.set;
3
4import java.util.EnumSet;
5
6import com.google.common.base.Optional;
7
8import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
9import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect;
10import de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator.NoLetterOrDigitTextInputsEvaluator;
11import de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator.TextInputEntryRepetitionsEvaluator;
12import de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator.TextInputRatioEvaluator;
13
14public class TextInputUsabiliyRuleset implements UsabilityRuleset {
15
16    private enum TextInputUsabilityRule implements UsabilityRule {
17
18        TEXT_FIELD_INPUT_RATIO {
19           
20            @Override
21            public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) {
22                return new TextInputRatioEvaluator(this, taskTree).evaluationResult();
23            }
24
25            @Override
26            public String ruleIdentifier() {
27                return this.name();
28            }
29
30        },
31
32        TEXT_FIELD_INPUT_REPETITIONS {
33
34            @Override
35            public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) {
36                return new TextInputEntryRepetitionsEvaluator(this, taskTree).evaluationResult();
37            }
38
39            @Override
40            public String ruleIdentifier() {
41                return this.name();
42            }
43
44        },
45
46        TEXT_FIELD_NO_LETTER_OR_DIGIT_RATIO {
47
48            @Override
49            public Optional<UsabilityDefect> evaluate(ITaskTree taskTree) {
50                return new NoLetterOrDigitTextInputsEvaluator(this, taskTree).evaluationResult();
51            }
52
53            @Override
54            public String ruleIdentifier() {
55                return this.name();
56            }
57
58
59        };
60       
61        public abstract Optional<UsabilityDefect> evaluate(ITaskTree taskTree);
62
63    }
64
65    private final EnumSet<TextInputUsabilityRule> TEXT_INPUT_USABILITY_RULESET = EnumSet
66        .allOf(TextInputUsabilityRule.class);
67
68    @Override
69    public EnumSet<? extends UsabilityRule> evaluationRules() {
70        return TEXT_INPUT_USABILITY_RULESET;
71    }
72
73}
Note: See TracBrowser for help on using the repository browser.