Package beans

Examples of beans.Stats


                try {
                    JSONObject jsonObject = (JSONObject) new JSONParser().parse(data);
                    for (Object c : (JSONArray) jsonObject.get("objects")){
                        jsonObject = (JSONObject) c;
                        total_count = total_count + (long) jsonObject.get("count");
                        Stats stats = new Stats(Integer.parseInt((String)jsonObject.get("id")),(String) jsonObject.get("name"),(long) jsonObject.get("count"));
                        stats_array.add(stats);
                    }
                } catch (ParseException ex) {
                    Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
       
        this.print.getjTextArea1().setText("************STATISTICS FOR MOVIES *******************" + "\n\n");
        //get percentage
        for (int i=0; i<stats_array.size();i++){
            Stats aux= (Statsstats_array.get(i);
            aux.setPercen(aux.getPercentage((float)100, aux.getCount(), total_count));
            this.print.getjTextArea1().setText(this.print.getjTextArea1().getText() + aux.getProduct_url() +" : " + aux.getPercen() + " % " +"\n");
        }
    }
View Full Code Here


                try {
                    JSONObject jsonObject = (JSONObject) new JSONParser().parse(data);
                    for (Object c : (JSONArray) jsonObject.get("objects")){
                        jsonObject = (JSONObject) c;
                        total_count = total_count + (long) jsonObject.get("count");
                        Stats stats = new Stats(Integer.parseInt((String)jsonObject.get("id")),(String) jsonObject.get("name"),(long) jsonObject.get("count"));
                        stats_array.add(stats);
                    }
                } catch (ParseException ex) {
                    Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        this.print.getjTextArea1().setText(this.print.getjTextArea1().getText() + "\n\n" +"************STATISTICS FOR BOOKS *******************" + "\n\n");
           
        //get percentage
        for (int i=0; i<stats_array.size();i++){
            Stats aux= (Statsstats_array.get(i);
            aux.setPercen(aux.getPercentage((float)100, aux.getCount(), total_count));
            this.print.getjTextArea1().setText(this.print.getjTextArea1().getText() + aux.getProduct_url() +" : " + aux.getPercen() + " % " +"\n");
        }     
    }
View Full Code Here

TOP

Related Classes of beans.Stats

Copyright © 2018 www.massapicom. 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.