source: trunk/quest-plugin-guitar/src/main/java/de/ugoe/cs/quest/plugin/guitar/eventcore/GUITAREventType.java @ 681

Last change on this file since 681 was 681, checked in by sherbold, 12 years ago
  • added getStringIdentifier() to interface IEventTarget
  • all event types and targets now implement equals and hashCode
  • Property svn:mime-type set to text/plain
File size: 1.5 KB
Line 
1
2package de.ugoe.cs.quest.plugin.guitar.eventcore;
3
4import de.ugoe.cs.quest.eventcore.IEventType;
5
6/**
7 *
8 * <p>
9 * TODO comment
10 * </p>
11 *
12 * @version $Revision: $ $Date: Aug 16, 2012$
13 * @author 2012, last modified by $Author: sherbold$
14 */
15public class GUITAREventType implements IEventType {
16
17    /**  */
18    private static final long serialVersionUID = 1L;
19
20    String guitarEventId;
21
22    public GUITAREventType(String eventId) {
23        this.guitarEventId = eventId;
24    }
25
26    /*
27     * (non-Javadoc)
28     *
29     * @see de.ugoe.cs.quest.eventcore.IEventType#getName()
30     */
31    @Override
32    public String getName() {
33        return "GUITAREventType";
34    }
35
36    /*
37     * (non-Javadoc)
38     *
39     * @see java.lang.Object#toString()
40     */
41    @Override
42    public String toString() {
43        return guitarEventId;
44    }
45
46    /*
47     * (non-Javadoc)
48     *
49     * @see java.lang.Object#equals(java.lang.Object)
50     */
51    @Override
52    public boolean equals(Object obj) {
53        if (obj instanceof GUITAREventType) {
54            if (guitarEventId != null) {
55                return guitarEventId.equals(((GUITAREventType) obj).guitarEventId);
56            }
57            else {
58                return ((GUITAREventType) obj).guitarEventId == null;
59            }
60        }
61        return false;
62    }
63
64    /*
65     * (non-Javadoc)
66     *
67     * @see java.lang.Object#hashCode()
68     */
69    @Override
70    public int hashCode() {
71        int hash = 37;
72        if (guitarEventId != null) {
73            hash = guitarEventId.hashCode();
74        }
75        return hash;
76    }
77
78}
Note: See TracBrowser for help on using the repository browser.