- Mastering Java for Data Science
- Alexey Grigorev
- 133字
- 2021-07-02 23:44:35
Commons Collections
The Java Collections API is very powerful and it defines a good set of abstractions for data structures in Java. The Commons Collections use these abstractions and extend the standard Collections API with new implementations as well as new collections. To include the library, use this snippet:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>
Some useful collections from this library are:
- Bag: This is an interface for sets that can hold the same element multiple times
- BidiMap: This stands for Bi-directional map. It can map from keys to values and from values to keys
It has some overlap with collections from Google Guava, explained in the next session, but has some additional collections that aren't implemented there. For example,
- LRUMap: This is used for implementing caches
- PatriciaTrie: This is used for fast string prefix lookups
推薦閱讀
- 同步:秩序如何從混沌中涌現
- 程序員修煉之道:從小工到專家
- 正則表達式必知必會
- Oracle RAC 11g實戰指南
- Dependency Injection with AngularJS
- 數據挖掘原理與SPSS Clementine應用寶典
- HikariCP連接池實戰
- 一本書講透Elasticsearch:原理、進階與工程實踐
- 大數據技術原理與應用:概念、存儲、處理、分析與應用
- 大數據測試技術:數據采集、分析與測試實踐(在線實驗+在線自測)
- 量化投資:交易模型開發與數據挖掘
- 一類智能優化算法的改進及應用研究
- 數據庫原理及應用實驗:基于GaussDB的實現方法
- 高效使用Redis:一書學透數據存儲與高可用集群
- 敏捷數據分析工具箱:深入解析ADW+OAC