Apache Commons Collections
http://commons.apache.org/proper/commons-collections/userguide.html
1. Utilities
- SetUtils
- CollectionUtils
- MapUtils
2.Maps
- Map Iteration
-
IterableMap map = new HashedMap();
MapIterator it = map.mapIterator();
while (it.hasNext()) {
Object key = it.next();
Object value = it.getValue();
it.setValue(newValue);
}
-
- Ordered Maps
-
OrderedMap map = new LinkedMap();
map.put("FIVE", "5");
map.put("SIX", "6");
map.put("SEVEN", "7");
map.firstKey(); // returns "FIVE"
map.nextKey("FIVE"); // returns "SIX"
map.nextKey("SIX"); // returns "SEVEN"
-
- Bidirectional Maps
-
BidiMap bidi = new TreeBidiMap();
bidi.put("SIX", "6");
bidi.get("SIX"); // returns "6"
bidi.getKey("6"); // returns "SIX"
bidi.removeValue("6"); // removes the mapping
BidiMap inverse = bidi.inverseBidiMap(); // returns a map with keys and values swapped
-
3.Bags
Bag bag = new HashBag();
bag.add("ONE", 6); // add 6 copies of "ONE"
bag.remove("ONE", 2); // removes 2 copies of "ONE"
bag.getCount("ONE"); // returns 4, the number of copies in the bag (6 - 2)
Apache Commons Collections的更多相关文章
- 关于java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap的错误解决办法
在JavaEE开发中,在把配置文件中的数据或用户表单提交上来的数据,封装在相应JavaBean的对象的对应属性中时:在实际开发中,使用第三方法工具包BeanUtils(commons-beanutil ...
- Apache Commons Collections 反序列化详细分析学习总结
0x01.环境准备: Apache Commons Collections 3.1版本,下载链接参考: https://www.secfree.com/a/231.html jd jui地址(将jar ...
- java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap报错解决
在使用 commons-beanutils-1.9.2.jarcommons-logging-1.1.1.jar 的时候报错 java.lang.NoClassDefFoundError: org/a ...
- java.lang.ClassNotFoundException: org.apache.commons.collections.FastHashMap
七月 26, 2017 1:52:15 上午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for ...
- 出现java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap错误问题解决
首先出现这个问题,你应该是用了 BeanUtils.populate(meter,map); import org.apache.commons.beanutils.BeanUtils;并且导入了co ...
- ysoserial分析【一】 之 Apache Commons Collections
目录 前言 基础知识 Transformer 利用InvokerTransformer造成命令执行 Map TransformedMap LazyMap AnnotationInvocationHan ...
- 关于使用工具类org.apache.commons.collections.ListUtils合并List的问题
今天在做项目时,需要将几个List进行合并,于是就用到了apache提供关于List操作的工具类ListUtils,但是在使用的过程中发现一些问题. public static void main(S ...
- 安卓项目中使用JSON引发的一个小错误 Multiple dex files define Lorg/apache/commons/collections/Buffer
原因: 这里添加的jar包和android自带的jar产生了冲突
- java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap-----commons-ctions版本问题
今天用到了一系列的第三方jar包,一环扣一环, 记住一个: 倘若你所导入的第三方jar包中的类一直显示未找到,那就是你的路径出问题了, /WEB-INF/lib目录下才是放第三方jar包位置, 但是今 ...
随机推荐
- 浅谈JDBC编程
一.概述 1.为什么要用JDBC 数据库是程序不可或缺的一部分,每一个网站和服务器的建设都需要数据库.对于大多数应用程序员(此处不包含数据库开发人员)来说,我们更多的不是在DBMS中对数据库进行操纵, ...
- C语言回顾-二维数组
1.二维数组:是一个特殊的一维数组 完全初始化: 1)int a[2][3]={{1,2,3},{2,3,4}}; 2)连续赋值int a[2][3]={1,2,3,2,3,4}; 3)可以省略第一维 ...
- 在Ubuntu14.04_ROS_indigo上安装Kinect2驱动和bridge
小乌龟:大乌龟,你这两周干么呢? 大乌龟:在Ubuntu14.04 ROS_indigo上装Kinect2的驱动和bridge 小乌龟:就装个驱动有什么难的 大乌龟:你说的对小乌龟,这确实不是问题,但 ...
- kthread_run【转】
转自:http://blog.csdn.net/zhangxuechao_/article/details/50876397 头文件 include/linux/kthread.h 创建并启动 /** ...
- thread.join 从异步执行变成同步
Java的线程模型为我们提供了更好的解决方案,这就是join方法.在前面已经讨论过,join的功能就是使用线程 从异步执行变成同步执行 当线程变成同步执行后,就和从普通的方法中得到返回数据没有什么区别 ...
- Dynamics AX 2012 R2 AIF 内部异常
今天,Reinhard发现某个入站端口,突然一直报错: The server was unable to process the request due to an internal erro ...
- phpcms v9调用自定义字段的方法步骤
代码如下:{loop $shigongtu $r}<img src="{$r[url]} " title="测试"/>{/loop} 2 首页,分页 ...
- Apache_proxy负载均衡和Session复制
今天上网查了查资料,之前使用apache的jk模块做负载均衡.后来觉得jk的负载配置有点死板,只能按照负载权重值来进行请求的分发,没有做到比较智能的负载平衡,并且使用mod_jk访问页面发现确实比较慢 ...
- 突击战UVa11729Commando War
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=117&page= ...
- 还是this的问题
var name = "The Window"; var object = { name : "My Object", getNameFunc ...