Examples of WnEfficientyTank


Examples of com.wot.shared.WnEfficientyTank

//        System.out.println("id:" + dossierToJsonTanks.getId() + " tier:" + dossierToJsonTanks.getTier() +" compDesc :" + dossierToJsonTanks.getCompDescr() + " title:" + dossierToJsonTanks.getTitle() + " Type_name:"+dossierToJsonTanks.getType_name()+ " Type:"+dossierToJsonTanks.getType());
//      }

      //Calcul du wn8 pour chaque tank
      //formule :
      WnEfficientyTank wnEfficientyTank = null ;
      HashMap<String, DataWnEfficientyTank> hMapWnEfficientyTankHashMap = new HashMap<String, DataWnEfficientyTank>();
     
      if (wnEfficientyTank == null) {
        URL urlWnEfficienty = null ;
        // recup des membres du clan NVS
        urlWnEfficienty = null ;
       
        if(WotServiceImpl.lieu.equalsIgnoreCase("boulot")){ //on passe par 1 proxy
          urlWnEfficienty = new URL(WotServiceImpl.proxy + "http://www.wnefficiency.net/exp/expected_tank_values_latest.json");       
        }
        else {
          //500006074
          urlWnEfficienty = new URL("http://www.wnefficiency.net/exp/expected_tank_values_latest.json");
        }
       
        HttpURLConnection connWN = (HttpURLConnection)urlWnEfficienty.openConnection();
        connWN.setReadTimeout(60000);
        connWN.setConnectTimeout(60000);
        connWN.getInputStream();
        reader = new BufferedReader(new InputStreamReader(connWN.getInputStream()));
       
        line = "";
        AllLines = "";
   
        while ((line = reader.readLine()) != null) {
          AllLines = AllLines + line;
        }
        reader.close();
        gson = new Gson();
        wnEfficientyTank = gson.fromJson(AllLines, WnEfficientyTank.class);
        System.out.println("wnEfficientyTank" + wnEfficientyTank);
       
        //transform list to hashMap for easy treatement
        //HashMap<String, DataWnEfficientyTank> hMapWnEfficientyTankHashMap = new HashMap<String, DataWnEfficientyTank>();
        for (DataWnEfficientyTank dataWnEfficientyTank : wnEfficientyTank.getData()) {
          //dataWnEfficientyTank.
          hMapWnEfficientyTankHashMap.put(dataWnEfficientyTank.getIDNum(), dataWnEfficientyTank);
        }
      }
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.