1 package org.musicontroller.core;
2
3
4 public class Instrument extends LinkableAbs {
5
6
7
8
9
10
11
12 @Override
13 public boolean equals(Object obj) {
14 boolean result = false;
15 if (this==obj) {
16 return true;
17 }
18 if (obj instanceof Instrument) {
19 Instrument other = (Instrument) obj;
20 if(this.getName()==null) {
21 result = other.getName()==null;
22 } else {
23 result = this.getName().equalsIgnoreCase(other.getName());
24 }
25 }
26 return result;
27 }
28
29 @Override
30 public int hashCode() {
31 int result = 0;
32 if(getName()!=null) {
33 result += getName().toLowerCase().hashCode();
34 }
35 return result;
36 }
37
38
39
40
41
42 public String toString() {
43 return getName();
44 }
45
46
47
48
49
50 public String getType() {
51 return "I";
52 }
53
54 }