1 |
|
---|
2 | package de.ugoe.cs.autoquest.usability.evaluation.rule.set;
|
---|
3 |
|
---|
4 | import java.util.EnumSet;
|
---|
5 |
|
---|
6 | import com.google.common.base.Optional;
|
---|
7 |
|
---|
8 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
|
---|
9 | import de.ugoe.cs.autoquest.usability.evaluation.result.UsabilityDefect;
|
---|
10 | import de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator.NoLetterOrDigitTextInputsEvaluator;
|
---|
11 | import de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator.TextInputEntryRepetitionsEvaluator;
|
---|
12 | import de.ugoe.cs.autoquest.usability.evaluation.rule.evaluator.TextInputRatioEvaluator;
|
---|
13 |
|
---|
14 | public 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 | }
|
---|