/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sensors;
import java.util.Enumeration;
import java.util.Vector;


/* class SensorVector
 */

public class SensorVector {

    public static Vector<Sensor> sensorVect = new Vector<Sensor>();

    public SensorVector(){};

    public void addSensor(String name, String pid, String hashName, int bytes, double prevVal)
    {
        Sensor s = new Sensor(name, pid, hashName, bytes, prevVal);
        sensorVect.add(s);

        return;
    }

    public Sensor getSensor(String name)
    {
         Enumeration<Sensor> en = sensorVect.elements();
        while (en.hasMoreElements()) {
            Sensor s = en.nextElement();
            if(s.getName().equals(name))
                return s;
        }

        return null;
     }



}
