Filter map to one row per multiple of ten,based on difference in decreasing order in java

后端 未结 1 953
挽巷
挽巷 2021-01-24 22:14

I have a method through which I can filter rows per multiple of ten i.e. I can filter rows which are nearest to multiple of tens such as 10,20,30 etc in ascending order.Now I wa

相关标签:
1条回答
  • 2021-01-24 22:39

    To represent it in reverse order do,order by time in your sql query and change the size of buckets to

     for (double v : vals) max = Math.max(max, v);
    Arrays.sort(vals);
    System.out.println("value at vals[0] c "+vals[0]);
    double min=vals[0];
    int m2=(int) Math.round(min);
    int m3=(int) Math.round(max);
    
    **int bucketCount = 1+((m3-m2)/10);
    double[] bucket =new double[bucketCount];
    double[][] buckets = new double[bucketCount][3];**
    
    0 讨论(0)
提交回复
热议问题