< prev index next >

src/java.desktop/share/classes/javax/sound/midi/Track.java

Print this page

        

*** 63,78 **** public class Track { // TODO: use arrays for faster access // the list containing the events ! private ArrayList<MidiEvent> eventsList = new ArrayList<>(); // use a hashset to detect duplicate events in add(MidiEvent) ! private HashSet<MidiEvent> set = new HashSet<>(); ! private MidiEvent eotEvent; /** * Package-private constructor. Constructs a new, empty Track object, which * initially contains one event, the meta-event End of Track. */ --- 63,78 ---- public class Track { // TODO: use arrays for faster access // the list containing the events ! private final ArrayList<MidiEvent> eventsList = new ArrayList<>(); // use a hashset to detect duplicate events in add(MidiEvent) ! private final HashSet<MidiEvent> set = new HashSet<>(); ! private final MidiEvent eotEvent; /** * Package-private constructor. Constructs a new, empty Track object, which * initially contains one event, the meta-event End of Track. */
*** 262,271 **** --- 262,272 ---- data[0] = (byte) META; data[1] = MidiUtils.META_END_OF_TRACK_TYPE; data[2] = 0; } + @Override public void setMessage(int type, byte[] data, int length) throws InvalidMidiDataException { throw new InvalidMidiDataException("cannot modify end of track message"); } } }
< prev index next >