[927] | 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. |
---|
[681] | 14 | |
---|
[922] | 15 | package de.ugoe.cs.autoquest.plugin.guitar.eventcore; |
---|
[556] | 16 | |
---|
[922] | 17 | import de.ugoe.cs.autoquest.eventcore.IEventType; |
---|
[556] | 18 | |
---|
| 19 | /** |
---|
| 20 | * <p> |
---|
[782] | 21 | * Event type of GUITAR events. The types are defined by eventIds. |
---|
[556] | 22 | * </p> |
---|
| 23 | * |
---|
[782] | 24 | * @version 1.0 |
---|
| 25 | * @author Steffen Herbold |
---|
[556] | 26 | */ |
---|
| 27 | public class GUITAREventType implements IEventType { |
---|
| 28 | |
---|
[782] | 29 | /** |
---|
| 30 | * <p> |
---|
| 31 | * Id for object serialization. |
---|
| 32 | * </p> |
---|
| 33 | */ |
---|
[556] | 34 | private static final long serialVersionUID = 1L; |
---|
[681] | 35 | |
---|
[782] | 36 | /** |
---|
| 37 | * <p> |
---|
| 38 | * GUITAR eventId of the event type. |
---|
| 39 | * </p> |
---|
| 40 | */ |
---|
[556] | 41 | String guitarEventId; |
---|
[681] | 42 | |
---|
[782] | 43 | /** |
---|
| 44 | * <p> |
---|
| 45 | * Constructor. Creates a new {@link GUITAREventType}. |
---|
| 46 | * </p> |
---|
| 47 | * |
---|
| 48 | * @param eventId |
---|
| 49 | * eventId of the event type |
---|
| 50 | */ |
---|
[556] | 51 | public GUITAREventType(String eventId) { |
---|
| 52 | this.guitarEventId = eventId; |
---|
| 53 | } |
---|
[681] | 54 | |
---|
| 55 | /* |
---|
| 56 | * (non-Javadoc) |
---|
| 57 | * |
---|
[922] | 58 | * @see de.ugoe.cs.autoquest.eventcore.IEventType#getName() |
---|
[556] | 59 | */ |
---|
| 60 | @Override |
---|
| 61 | public String getName() { |
---|
| 62 | return "GUITAREventType"; |
---|
| 63 | } |
---|
[681] | 64 | |
---|
[556] | 65 | /* |
---|
| 66 | * (non-Javadoc) |
---|
[681] | 67 | * |
---|
[556] | 68 | * @see java.lang.Object#toString() |
---|
| 69 | */ |
---|
| 70 | @Override |
---|
| 71 | public String toString() { |
---|
| 72 | return guitarEventId; |
---|
| 73 | } |
---|
| 74 | |
---|
[681] | 75 | /* |
---|
| 76 | * (non-Javadoc) |
---|
| 77 | * |
---|
| 78 | * @see java.lang.Object#equals(java.lang.Object) |
---|
| 79 | */ |
---|
| 80 | @Override |
---|
| 81 | public boolean equals(Object obj) { |
---|
| 82 | if (obj instanceof GUITAREventType) { |
---|
| 83 | if (guitarEventId != null) { |
---|
| 84 | return guitarEventId.equals(((GUITAREventType) obj).guitarEventId); |
---|
| 85 | } |
---|
| 86 | else { |
---|
| 87 | return ((GUITAREventType) obj).guitarEventId == null; |
---|
| 88 | } |
---|
| 89 | } |
---|
| 90 | return false; |
---|
| 91 | } |
---|
| 92 | |
---|
| 93 | /* |
---|
| 94 | * (non-Javadoc) |
---|
| 95 | * |
---|
| 96 | * @see java.lang.Object#hashCode() |
---|
| 97 | */ |
---|
| 98 | @Override |
---|
| 99 | public int hashCode() { |
---|
| 100 | int hash = 37; |
---|
| 101 | if (guitarEventId != null) { |
---|
| 102 | hash = guitarEventId.hashCode(); |
---|
| 103 | } |
---|
| 104 | return hash; |
---|
| 105 | } |
---|
| 106 | |
---|
[556] | 107 | } |
---|