zoukankan      html  css  js  c++  java
  • Map转化为List

     List<JfAuction> jfAuctionListValue=null;                if(jfAuctionList!=null && jfAuctionList.size()>0){                    Map<Integer, JfAuction> jfAuctionMap = new HashMap<Integer, JfAuction>();                    for(JfAuction jfAuction:jfAuctionList){                         if (jfAuctionMap.get(jfAuction.getUser().getId()) == null) {                             // 如果没有此类型,则添加此类型的数值                            jfAuctionMap.put(jfAuction.getUser().getId(), jfAuction);                      }else{                            // 如果有此类型,则把此类型的数值修改为-->原来的数值+新数值,实现类似sum功能                             Integer sum=jfAuction.getScore()+jfAuctionMap.get(jfAuction.getUser().getId()).getScore();                           jfAuction.setScore(sum);                            jfAuctionMap.put(jfAuction.getUser().getId(), jfAuction);                        }                     }

                    }

  • 相关阅读:
    iOS越狱后必装软件
    构建iOS交叉编译环境
    pycurl库使用详解
    iFiles浏览iphone文件
    Iphone通过ssh进行访问
    YShow性能测试平台搭建
    from my mac
    LR性能分析
    react服务端渲染(七)redux添加
    react服务端渲染(六)路由
  • 原文地址:https://www.cnblogs.com/zifashaonian10000/p/4218294.html
Copyright © 2011-2022 走看看