* @author Einar Pehrson
*/
-public class MooNote extends MidiEvent implements Cloneable {
+public class MooNote extends MidiEvent implements Cloneable, Comparable {
private MidiEvent noteOffEvent;
private ShortMessage noteOnMsg, noteOffMsg;
new MidiEvent((ShortMessage)noteOffEvent.getMessage().clone(), noteOffEvent.getTick())
);
}
+
+ /**
+ * Compares this note to another note.
+ * @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
+ */
+ public int compareTo(Object o) {
+ return (int)(((MidiEvent)o).getTick() - getTick());
+ }
+
}