public void addBattery(int batteryNum, float voltage)
    {
        if (batteries == null)
        {
            batteries.add(new BatteryData(batteryNum, voltage));
        }
        else
        {
            int i = 0;
            for(BatteryData bd: batteries)
            {
               if(bd.getBatteryNum() < batteryNum){ 
                   continue; 
               }else if(bd.getBatteryNum() == batteryNum){
                   break;
               }else{
                   batteries.add(i, new BatteryData(batteryNum, voltage));
               }
               i++;
            }
        }
        
    }