public void  setValueAt(Object val, int index) {
        if (type == Integer.class) {
            int[] foo = (int[])vals;
            foo[index] = ((Integer)val).intValue();
        } else {
            double[] foo = (double[])vals;
            foo[index] = ((Double)val).doubleValue();
        }
    }