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包位置, 但是今 ...
随机推荐
- [SQL入门级] 上篇被移出园子首页,那这篇咱就'薄利多销'
这个系列的博文知识回顾sql知识作的记录,温故而知新.上一篇内容达不到知识分享的层级被移出园子首页,对不住各位看官,内容简单了些.下面咱就记录多一些的基础知识,薄利多销: 控制用户权限 • 创建用户 ...
- 使用FastJSON,将对象或数组和JSON串互转
Fastjson,是阿里巴巴提供的一个Java语言编写的高性能功能完善的JSON库.其开源的下载网址为:https://github.com/AlibabaTech/fastjson. 示例代码如下: ...
- kthread_run【转】
转自:http://blog.csdn.net/zhangxuechao_/article/details/50876397 头文件 include/linux/kthread.h 创建并启动 /** ...
- linux 时间管理——概念、注意点(一)【转】
转自:http://www.cnblogs.com/openix/p/3324243.html 参考:1.http://bbs.eyeler.com/thread-69-1-1.html ...
- iOS AFNetworking HTTPS 认证
HTTPS 中双向认证SSL 协议的具体过程: 这里总结为详细的步骤: ① 浏览器发送一个连接请求给安全服务器. ② 服务器将自己的证书,以及同证书相关的信息发送给客户浏览器. ③ 客户浏览器检查服务 ...
- maven项目和普通项目转换
- maven的搭建
1.安装JDK. 2.Maven是 Apache 下的一个项目,官网下载 Maven:http://maven.apache.org/download.cgi 系统变量:M2_HOME= G:\vis ...
- JS事件
JS事件: 声明:为了事件对象event跨浏览器兼容: var oEvent==ev||event; 所以在下面用到 event 的地方都用 oEvent 代替 1)doucument的 ...
- 传感器之超声波测距HC-SR04
一.前言 HC-SR04超声波测距模块可提供2cm-400cm的非接触式距离感测功能,测距精度可达高到3mm:模块包括超声波发射器.接收器与控制电路.像智能小车的测距以及转向,或是一些项目中,常常会用 ...
- Countries in War -POJ3114Tarjan缩点+SPFA
Countries in War Time Limit: 1000MS Memory Limit: 65536K Description In the year 2050, after differe ...