package org.ttn.android.sample;

import com.robinhood.spark.SparkAdapter;

import java.util.List;


public class TemperatureAdapter extends SparkAdapter {

    List<Payload> mPayloads;

    public TemperatureAdapter(List<Payload> payloads) {
        mPayloads = payloads;
    }

    @Override
    public int getCount() {
        return mPayloads.size();
    }

    @Override
    public Object getItem(int index) {
        return mPayloads.get(index);
    }

    @Override
    public float getY(int index) {
        return Float.valueOf(mPayloads.get(index).mTemp.toString());
    }
}
