package rocketpower.library;


public class TrackKey implements Comparable<TrackKey> {
    public enum KeyType {
        STEP,
        LINEAR,
        SMOOTH,
        RAMP
    }

    private int row;
    private float value;
    private KeyType keyType;

    public TrackKey(int row, float value, KeyType keyType) {
        this.row = row;
        this.value = value;
        this.keyType = keyType;
    }

    public int getRow() {
        return row;
    }

    public float getValue() {
        return value;
    }

    public KeyType getKeyType() {
        return keyType;
    }

    public int compareTo(TrackKey other) {
        return row > other.row ? 1 : row < other.row ? -1 : 0;
    }

    public String toString() {
        return String.format("TrackKey(row=%d value=%f type=%s)", row, value, keyType);
    }

    public static double interpolate(TrackKey first, TrackKey second, double row) {
        double t = (row - first.row) / (second.row - first.row);

        switch (first.keyType) {
            case STEP:
                return first.value;
            //case KeyType.LINEAR:
            case SMOOTH:
                t = t * t * (3 - 2*t);
                break;
            case RAMP:
                t = Math.pow(t, 2.0);
                break;
        }

        return first.value + (second.value - first.value) * t;
    }
}

@@ -468,104 +468,329 @@
 lic 
-float getValue() %7B%0A        return value;%0A    %7D%0A%0A    public KeyType getKeyType() %7B%0A        return
+void setRow(int row) %7B%0A        this.row = row;%0A    %7D%0A%0A    public float getValue() %7B%0A        return value;%0A    %7D%0A%0A    public void setValue(float value) %7B%0A        this.value = value;%0A    %7D%0A%0A    public KeyType getKeyType() %7B%0A        return keyType;%0A    %7D%0A%0A    public void setKeyType(KeyType keyType) %7B%0A        this.keyType =
  key

Implement TrackKey member variable setters