Example #1
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return true;
   if (getClass() != obj.getClass()) return false;
   final Note other = (Note) obj;
   if (duration != other.duration) return false;
   if (!instrument.equals(other.instrument)) return false;
   if (!pitch.equals(other.pitch)) return false;
   return true;
 }
Example #2
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   long temp;
   temp = Double.doubleToLongBits(duration);
   result = prime * result + (int) (temp ^ (temp >>> 32));
   result = prime * result + ((instrument == null) ? 0 : instrument.hashCode());
   result = prime * result + ((pitch == null) ? 0 : pitch.hashCode());
   return result;
 }
Example #3
0
 @Override
 public String toString() {
   return pitch.toString() + duration;
 }