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的更多相关文章

  1. 关于java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap的错误解决办法

    在JavaEE开发中,在把配置文件中的数据或用户表单提交上来的数据,封装在相应JavaBean的对象的对应属性中时:在实际开发中,使用第三方法工具包BeanUtils(commons-beanutil ...

  2. Apache Commons Collections 反序列化详细分析学习总结

    0x01.环境准备: Apache Commons Collections 3.1版本,下载链接参考: https://www.secfree.com/a/231.html jd jui地址(将jar ...

  3. java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap报错解决

    在使用 commons-beanutils-1.9.2.jarcommons-logging-1.1.1.jar 的时候报错 java.lang.NoClassDefFoundError: org/a ...

  4. java.lang.ClassNotFoundException: org.apache.commons.collections.FastHashMap

    七月 26, 2017 1:52:15 上午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for ...

  5. 出现java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap错误问题解决

    首先出现这个问题,你应该是用了 BeanUtils.populate(meter,map); import org.apache.commons.beanutils.BeanUtils;并且导入了co ...

  6. ysoserial分析【一】 之 Apache Commons Collections

    目录 前言 基础知识 Transformer 利用InvokerTransformer造成命令执行 Map TransformedMap LazyMap AnnotationInvocationHan ...

  7. 关于使用工具类org.apache.commons.collections.ListUtils合并List的问题

    今天在做项目时,需要将几个List进行合并,于是就用到了apache提供关于List操作的工具类ListUtils,但是在使用的过程中发现一些问题. public static void main(S ...

  8. 安卓项目中使用JSON引发的一个小错误 Multiple dex files define Lorg/apache/commons/collections/Buffer

    原因: 这里添加的jar包和android自带的jar产生了冲突

  9. java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap-----commons-ctions版本问题

    今天用到了一系列的第三方jar包,一环扣一环, 记住一个: 倘若你所导入的第三方jar包中的类一直显示未找到,那就是你的路径出问题了, /WEB-INF/lib目录下才是放第三方jar包位置, 但是今 ...

随机推荐

  1. Wireshark工控协议

    Wireshark是一个强大开源流量与协议分析工具,除了传统网络协议解码外,还支持众多主流和标准工控协议的分析与解码. 序号 协议类型 源码下载 简介 1 Siemens S7 https://git ...

  2. 用node.js给图片加水印

    一.准备工作: 首先,确保你本地已经安装好了node环境.然后,我们进行图像编辑操作需要用到一个Node.js的库:images.这个库的地址是:https://github.com/zhangyua ...

  3. 手机APP功能测试经验分享2016.06.06

    1.登录时,Android和IOS同样的操作,提示信息不一致: 2.注册等页面切换成横屏容易不兼容.把内存卡去掉,再发送图片.音频.视频容易出错. 3.Android和IOS同样的功能,同样的原型图, ...

  4. 移动端接口:java写get方式访问数据(springmvc+spring。。。)

    很多时候,一个问题想明白,找对点了再去问,这样被问的人也知道怎么给你讲,你也听的明白. 就比如做移动端接口,上去就问 怎么弄接口呀,其实是没找到主要的点上,所以不知道怎么弄,那个点就是手机接口是干嘛的 ...

  5. Bootstrap 模态框(Modal)插件

    原文链接:http://www.runoob.com/bootstrap/bootstrap-modal-plugin.html Bootstrap 模态框(Modal)插件 模态框(Modal)是覆 ...

  6. Discuz的安装 (原创帖,转载请注明出处)

    ========================写在前面的话========================= 1.LAMP环境搭建请查看这篇日志:http://www.cnblogs.com/yic ...

  7. SourceTree 免登录跳过初始设置 - 转

    转自:http://www.cnblogs.com/xiofee/p/sourcetree_pass_initialization_setup.html 在SourceTree的配置目录新建(或修改) ...

  8. selenium截图对比校验方法

    /**对比图片进行校验是否成功**/package com.allin.pc;import java.awt.image.BufferedImage;import java.awt.image.Dat ...

  9. TensorFlow白皮书

    TensorFlow [1] is an interface for expressing machine learning algorithms, and an implementation for ...

  10. InstallShield 2015 LimitedEdition VS2012 覆盖安装

    转载:http://tieba.baidu.com/p/3596681127 1. 在General Information里,修改Product Version为新的版本号,此版本号应大于旧的版本号 ...