@@ -0,0 +1,1128 @@
+package rocketpower.library;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0A%0A%0Apublic class Track %7B%0A    private String name;%0A    // ArrayList stored in sorted order by%0A    // key trackKey.row.%0A    // Not the most efficient data structure%0A    // for this use, but suffices for now.%0A    private ArrayList%3CTrackKey%3E keys;%0A%0A    public Track(String name) %7B%0A        this.name = name;%0A        this.keys = new ArrayList%3CTrackKey%3E();%0A    %7D%0A%0A    /*%0A     * Find key for the given row.%0A     *%0A     * @returns Key if found, otherwise null.%0A     */%0A    public TrackKey getKey(int row) %7B%0A        // TODO: better way to do this search%0A        int index = Collections.binarySearch(this.keys, new TrackKey(row, 0.f, TrackKey.KeyType.STEP));%0A        return this.keys.get(index);%0A    %7D%0A%0A    public void insertKey(TrackKey key) %7B%0A        this.keys.add(key);%0A        Collections.sort(keys);%0A    %7D%0A%0A    /*%0A     * For testing%0A     */%0A    public void printKeys() %7B%0A        for (TrackKey key: keys)%0A            System.out.println(key);%0A    %7D%0A%0A    public String toString() %7B%0A        return String.format(%22Track(keys=%25d)%22, keys.size());%0A    %7D%0A%7D%0A

Implement first version of Track