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

个体工商户 网站备案在青岛做阿里巴巴网站找谁

个体工商户 网站备案,在青岛做阿里巴巴网站找谁,免费在线网页代理,长春三合一网站建设针对我最近在GNU Trove库上发表的《 发现Java原始资源集合的处理 》一书 #xff0c; TheAlchemist指出了fastutil优于trove的一些优点#xff1a;“我更喜欢fastutil#xff08; http://fastutil.di.unimi.it/ #xff09;#xff0c;因为它仍在积极开发中#xff0c;具… 针对我最近在GNU Trove库上发表的《 发现Java原始资源集合的处理 》一书 TheAlchemist指出了fastutil优于trove的一些优点“我更喜欢fastutil http://fastutil.di.unimi.it/ 因为它仍在积极开发中具有更多功能支持大尺寸 2 ^ 32并且具有更好的文档。” 阿提拉-米哈伊·巴拉兹已借调第二个“I TheAlchemist的建议为fastutil此 这是一个很棒的图书馆。” 在这篇文章中我从以前看过trove的相同角度研究了fastutil 。 在fastutil主页上将fastutil描述为Java TM Collections Framework的扩展它提供了“特定类型的映射集合列表和队列具有较小的内存占用以及快速的访问和插入”以及“大型64位数组设置和列表以及用于二进制和文本文件的快速实用的I / O类。” fastutil的许可证是Apache License版本2 而fastutil的当前版本需要Java 7或更高版本。 目前截至撰写本文时 Java 6和Java 5也可以下载“未维护”的fastutil版本。 通过与标准Java集合使用的API调用相同的API调用可以将元素添加到FastUtil集合中如下面的代码清单所示该代码清单将在JDK ArrayList中插入元素与在FastUtil DoubleArrayList中插入元素进行比较。 使用JDK插入双打和使用FastUtil DoubleArrayList插入双打 /*** Demonstrate standard JDK {code ArrayListDouble}* with some JDK 8 functionality.*/ public void demonstrateJdkArrayListForDoubles() {final ArrayListDouble doubles new ArrayList();doubles.add(15.5);doubles.add(24.4);doubles.add(36.3);doubles.add(67.6);doubles.add(10.0);out.println(JDK ArrayListDouble:);out.println(\tDoubles List: doubles); }/*** Demonstrate use of DoubleArrayList and show how* similar using it is to using {code ArrayListDouble}.*/ public void demonstrateFastUtilArrayListForDoubles() {// Demonstrate adding elements to DoubleArrayList is// exactly like adding elements to ArrayListDouble.final DoubleArrayList doubles new DoubleArrayList();doubles.add(15.5);doubles.add(24.4);doubles.add(36.3);doubles.add(67.6);doubles.add(10.0);out.println(FastUtil DoubleArrayList:); // DoubleArrayList overrides toString()out.println(\tDoubles List: doubles); } 当执行上述两种方法时写入标准输出的双精度项列表看起来完全相同即使用相同的方括号括住以逗号分隔的双精度值。 FastUtil集合倾向于实现适当的JDK集合接口。 例如刚刚演示的类DoubleArrayList实现了几个接口包括Collection Double和List Double。 事实证明 DoubleArrayList还实现了it.unimi.dsi.fastutil.doubles.DoubleStack和it.unimi.dsi.fastutil.Stack Double 。 下一个代码清单中展示了使用此类作为堆栈的能力。 使用FastUtil的DoubleArrayList作为堆栈 /*** Demonstrate FastUtils Double Stack.** FastUtils DoubleStack allows access to its* contents via push, pop, and peek. It is declared* as a DoubleArrayList type here so that the size()* method is available without casting.*/ public void demonstrateFastUtilDoubleStack() {final DoubleArrayList stack new DoubleArrayList();stack.push(15.5);stack.push(17.3);stack.push(16.6);stack.push(2.2);out.println(FastUtil Stack of Doubles);out.println(\tPeek: stack.peek(0) ; After Size: stack.size());out.println(\tPop: stack.pop() ; After Size: stack.size());out.println(\tPeek: stack.peek(0) ; After Size: stack.size()); } 正如我在Trove上的博客文章中所讨论的那样Trove提供了一个gnu.trove.TCollections类该类类似于java.util.Collections的 子集。 FastUtil提供了类似的功能但是这种提供静态方法以对FastUtil集合起作用的方法通过静态方法被分为特定于类型的类型和特定于结构的类而不是在具有静态方法的单个类中。 下一个代码清单演示将这些特定于类型和特定于结构的类之一与静态方法IntSets结合使用 并将其与FastUtil IntLinkedOpenHashSet结合使用。 顾名思义 IntSets类提供了“使用[int]特定的集可以做有用的事情的静态方法和对象。” 将IntSet与IntLinkedOpenHashSet一起使用 /*** Demonstrate one of FastUtils equivalents of the* java.util.Collections class. FastUtil separates its* grouping of static methods into classes that are* specific to the data type of the collection and to* the data structure type of the collection.*/ public void demonstrateFastUtilCollectionsClass() {final IntLinkedOpenHashSet integers new IntLinkedOpenHashSet();integers.add(5);integers.add(7);integers.add(3);integers.add(1);final IntSet unmodifiableIntegers IntSets.unmodifiable(integers);out.println(Unmodifiable Integers:);out.println(\tClass: unmodifiableIntegers.getClass().getCanonicalName());try{unmodifiableIntegers.add(15);}catch (Exception ex){out.println(\tException caught: ex);} } FastUtil支持使用显式迭代器和Java SE 5引入的for-each循环的标准Java迭代方法。 因为FastUtil集合实现java.lang.Iterable所以FastUtil集合甚至使用.forEach支持JDK 8样式 假定代码是在JDK 8上构建和运行的。 这些将在下一个代码清单中进行演示。 以标准Java样式迭代FastUtil集合 /*** Demonstrate traditional Java iteration of a* FastUtil collection.*/ public void demonstrateIterationWithIterator() {final LongOpenHashSet longs new LongOpenHashSet();longs.add(15);longs.add(6);longs.add(12);longs.add(13);longs.add(2);final LongIterator longIterator longs.iterator();while (longIterator.hasNext()){final long longValue longIterator.next();out.print(longValue );} }/*** Demonstrate iteration of a FastUtil collection* using Javas enhanced for-each approach.*/ public void demonstrateIterationWithForEach() {final LongLinkedOpenHashSet longs new LongLinkedOpenHashSet();longs.add(15);longs.add(6);longs.add(12);longs.add(13);longs.add(2);for (final long longValue : longs){out.println(longValue );} }/*** Demonstrate iteration of a FastUtil collection* using JDK 8 .forEach approach.*/ public void demonstrateIterationWithJdk8ForEach() {final LongLinkedOpenHashSet longs new LongLinkedOpenHashSet();longs.add(15);longs.add(6);longs.add(12);longs.add(13);longs.add(2);longs.forEach(longValue - out.print(longValue )); }与FastUtil相关的其他观察 由于FastUtil集合实现标准的JDK 8集合接口因此可以很容易地使用熟悉的Java习惯用法来获取和使用这些API。 FastUtil集合通常提供一个构造函数该构造函数接受基础数据类型的数组以及重写的toArray方法和特定于类型的方法例如toDoubleArray [用于双向定位的集合]以数组形式提供其数据元素。原语。 FastUtil集合通常提供显式覆盖的toString()实现这些实现允许像JDK集合一样轻松编写各个数据元素并且与Java数组需要Arrays.toString方法不同。 FastUtil的Java软件包通常按原始类型进行组织并且该原始类型的各种数据结构类型的特定实现都在同一软件包中进行。 例如程序包的名称类似it.unimi.dsi.fastutil.doubles it.unimi.dsi.fastutil.ints等。 因为每个FastUtil集合特定于特定的原始数据类型所以每个集合都不需要通用参数并且没有与通用相关的问题例如擦除。 我还没有看到FastUtil像Trove那样利用特定于类型的方法来收集特定于类型的方法这可能是因为FastUtil更紧密地实现了相应的Java集合接口。 学习使用FastUtil时 FastUtil的Javadoc API文档可能是最佳的起点。 在FastUtil的基于Javadoc的API文档中类接口枚举和包通常都记录得很好。 结论 与Trove一样FastUtil是一个库可以用来更有效地就内存和性能而言与Java集合一起使用。 虽然Trove以前似乎是众多选择中最受欢迎的但由于包括TheAlchemist所列举的原因FastUtil可能是当前最受欢迎的选择 “仍在积极开发中具有更多功能支持大尺寸 2 ^ 32 并具有更好的文档。” 除Trove和FastUtil外 类似的库还包括Java的高性能基元集合 HPPC Koloboke Goldman Sachs集合 Mahout集合和Javolution 。 翻译自: https://www.javacodegeeks.com/2016/01/leaner-java-collections-with-fastutil.html
http://www.huolong8.cn/news/370733/

相关文章:

  • 网站建设案例简介怎么写网站活动打造
  • 广州公司做网站运城做网站方式方法
  • 自助个人网站免费推广网站大全网
  • wordpress ip 跳转湛江网站优化
  • 北京工程质量建设协会网站如何修改网站title
  • 扁平式网站源码flash分享网站
  • 泉州做网站seo网站前台架构
  • asp.net个人网站模板二级建造师个人注册查询系统
  • 不用付费不用登录的网站网上超市怎么做
  • 找国外人做网站做网站的重要性
  • 南昌优化网站分析东莞建网站公司
  • 阿里云成功备案的网站增加域名深圳西乡网站建设
  • seo网站推广杭州网页设计实训报告1500字通用
  • 网站内容策略网站内链结构是什么意思
  • 黄骅市住房和城乡建设局网站网速
  • php开源网站制作手机网站建设
  • 怎么给网站做seo优化公司要想做个网站这么弄
  • 泉州建站模板搭建网站平台建设合同模版
  • 央企网站群建设中标公告wordpress 禁止删除分类
  • pdf怎么做电子书下载网站辽宁建设工程信息网查询系统
  • 做英文小工具网站赚钱建站公司常见提成比例
  • 在线做视频网站织梦网站标题被篡改
  • 石家庄做手机网站建设凉州区住房城乡建设局网站
  • 自适应文章网站模板pc端网站优缺点
  • 网站图片制作化工集团网站建设 中企动力
  • 网站上全景云台怎么做的怎么做网络游戏推广
  • 织梦 帝国 php cms 媒体网站 哪个重庆旅游攻略
  • phpcmsv9蓝色简洁下载网站模板福建百川建设有限公司网站
  • 网站建设 竞赛 方案个人官网网站源码
  • 酒店网站方案邢台企业网站制作公司