The data list<string,object> Behaviordata are as follows:
What I'm going to do is show this list of the top four (except [0] of that hundred percent) data. displayed on the page.
List<behaviordata> Behaviordata = This. Behaviorservice.searchbehaviorbycondition (behavioranalysis);//To calculate the illegal behavior through the cycle TOP4 float[] BehaviorTop4 =New float[Behaviordata.size ()-1]; for(inti = 1; I <behaviordata.size (); i++) {String percent=Behaviordata.get (i). Getviolationproportion (); if(percent!=NULL) {Behaviortop4[i-1] = float.parsefloat (percent.replace ("%", "" ")); }} arrays.sort (BEHAVIORTOP4); List<BehaviorData> BEHAVIORNUM4 =NewArraylist<behaviordata>(); for(inti = 1; I <=4; i++) {Float x= behaviortop4[behaviortop4.length-i]; DecimalFormat DF=NewDecimalFormat ("0.00"); Df.format (x); String value= x+ "%"; for(intj = 0; J < Behaviordata.size (); J + +) { if(Value.equals (Behaviordata.get (j). Getviolationproportion ())) {Behaviordata Mer=NewBehaviordata (); Mer.setviolationproportion (value); Mer.setbehaviorname (Behaviordata.get (j). Getbehaviorname ()); Behaviornum4.add (MER); Break; } } }
Sorting-related issues (Jq,java) _1123