source: trunk/autoquest-plugin-android/src/main/java/de/ugoe/cs/autoquest/eventcore/gui/CharacterTyped.java @ 1819

Last change on this file since 1819 was 1819, checked in by funger, 10 years ago
  • add eventcore parts to handle touch events and type events to android-plugin
  • Property svn:mime-type set to text/plain
File size: 2.3 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.eventcore.gui;
16
17/**
18 * <p>
19 * Event type for typing strings.
20 * </p>
21 *
22 * @version 1.0
23 * @author Florian Unger
24 */
25public class CharacterTyped implements IInteraction {
26
27    /**
28     * <p>
29     * Id for object serialization.
30     * </p>
31     */
32    private static final long serialVersionUID = 1L;
33
34    /**
35     * <p>
36     * The string associated with the interaction.
37     * </p>
38     */
39    private String string;
40
41    /**
42     * <p>
43     * Constructor. Creates a new CharacterTyped.
44     * </p>
45     *
46     * @param string
47     *            string associated with the interaction
48     */
49    public CharacterTyped(String string) {
50        this.string = string;
51    }
52
53    @Override
54    public String getName() {
55        return "StringTyped: " + string;
56    }
57
58    @Override
59    public boolean startsLogicalSequence() {
60        return false;
61    }
62
63    @Override
64    public boolean finishesLogicalSequence() {
65        return false;
66    }
67
68    /*
69     * (non-Javadoc)
70     *
71     * @see java.lang.Object#equals(java.lang.Object)
72     */
73    @Override
74    public boolean equals(Object obj) {
75        if (obj instanceof CharacterTyped) {
76            return (((CharacterTyped) obj).getString() == getString());
77        }
78        return false;
79    }
80
81    /*
82     * (non-Javadoc)
83     *
84     * @see java.lang.Object#hashCode()
85     */
86    @Override
87    public int hashCode() {
88        return getString().hashCode();
89    }
90
91    /**
92     * <p>
93     * Returns the string associated with the interaction.
94     * </p>
95     *
96     * @return the string
97     */
98    public String getString() {
99        return string;
100    }
101
102}
Note: See TracBrowser for help on using the repository browser.