当前位置: 首页 > news >正文

建设银行校招网站入口深圳建网站

建设银行校招网站入口,深圳建网站,tv电视盒子企业网站模板,seo优化方案ppt文章目录 1. 场景2. 拆分集合方法#xff08;写了三种#xff09;3. 格式化打印方法 1. 场景 在数据库批量操作时#xff0c;有可能数据量过大#xff0c;不能一次性操作#xff0c;所以需要将大集合拆分为多个小集合进行多次操作 2. 拆分集合方法#xff08;写了三种写了三种3. 格式化打印方法 1. 场景 在数据库批量操作时有可能数据量过大不能一次性操作所以需要将大集合拆分为多个小集合进行多次操作 2. 拆分集合方法写了三种 import com.google.common.collect.Lists; import com.xin.demo.fastjsondemo.FastJsonFormatPrintUtils; import org.apache.commons.collections4.CollectionUtils;import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream;public class PartitionListDemo {private static final int PARTITION_SIZE 10;public static void main(String[] args) {// 大集合ListString list new ArrayList();for (int i 0; i 33; i) {list.add(xinliushijian i);}// 方法1 guava工具ListListString partitionList Lists.partition(list, PARTITION_SIZE);FastJsonFormatPrintUtils.formatPrint(partitionList);System.out.println();// 方法2 stream流实现ListListString partitionList1 partList1(list, PARTITION_SIZE);FastJsonFormatPrintUtils.formatPrint(partitionList1);// 方法3 普通方法实现partList2(list, PARTITION_SIZE);}public static T ListListT partList1(ListT list, int size) {if (CollectionUtils.isEmpty(list) || size 1) {return new ArrayList();}ListListT partList IntStream.range(0, list.size()).boxed().collect(Collectors.groupingBy(index - index / size)).values().stream().map(indices - indices.stream().map(list::get).collect(Collectors.toList())).collect(Collectors.toList());return partList;}public static T ListListT partList2(ListT list, int size) {if (CollectionUtils.isEmpty(list) || size 1) {return new ArrayList();}ListListT allPartList new ArrayList();for (int i 0; i list.size(); isize) {if (i size list.size()) {size list.size() - i;}ListT parList list.subList(i, i size);allPartList.add(parList);}FastJsonFormatPrintUtils.formatPrint(allPartList);return allPartList;}} 3. 格式化打印方法 import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.JSON;public class FastJsonFormatPrintUtils {public static void formatPrint(Object object) {String pretty JSON.toJSONString(object, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue,SerializerFeature.WriteDateUseDateFormat);System.out.println(pretty);}}
http://www.hkea.cn/news/14291330/

相关文章:

  • 贵州省交通建设集团网站视频 播放网站怎么做
  • 建设厅网站生成案卷生成不了广告设计培训内容
  • 酒店网站建设方案书网站个人备案 企业备案
  • 泉州网站seo上海网站建设联系
  • seo优化能提高网站的流量吗商用图片素材网站
  • 网站制作网站搭建高权重友情链接
  • 做药物分析常用网站色盲能治好吗
  • 网站推广方法有哪些wordpress当面付插件
  • 优秀网站首页设计步骤怎么把网站管理系统
  • 合肥网站建设是什么意思网页设计模板素材代码
  • 泰安网站建设入门合同管理软件
  • 怎么做网站生意彩票网站开发演示
  • 贵阳网站推广¥做下拉去118cr浙江大成建设集团有限公司网站
  • 北京网站优化首页网站建设的基本流程图
  • 富阳营销型网站建设菜鸟学做网站
  • 临沂建设网站公司网站建设和维护试卷
  • 高密微网站建设个人做美食视频网站
  • 公司网站建设多少费用哪里济南兴田德润有活动吗扬州公司做网站
  • 南浔区住房和城乡建设局网站discuz下载官网
  • 青岛做网站企业排名上海建设房屋网站
  • 自己做的网站如何兼容南京网站建设公司开发
  • 衡阳建设学校网站个人网站需不需要备案
  • 校园兼职网站开发用例图网站开发答辩会问哪些问题
  • 如何创立个人网站最新网站发布
  • 数字媒体应用 网站开发网站建设的方法和技术
  • 重庆万州网站建设哪家好公司公共邮箱怎么申请
  • 源代码怎么做网站外贸网站建设大概多少钱
  • 合肥响应式网站开发方案刷赞网站推广永久
  • 网站域名一年多少钱网站更换名称需要重新备案吗
  • 美容网站建设网页设计素材代码