zoukankan      html  css  js  c++  java
  • 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)
  • 相关阅读:
    正则表达式
    jquery获取(设置)节点的属性与属性值
    Easy UI
    javascript中数组常用的方法
    DOM节点
    Echarts的基本用法
    CSS小结
    草稿1
    CSS基础
    wordbreak:breakall和wordwrap:breakword的区别
  • 原文地址:https://www.cnblogs.com/zeng200103/p/3790549.html
Copyright © 2011-2022 走看看