Java编程中的HashSet和BitSet详解-创新互联
创新互联www.cdcxhl.cn八线动态BGP香港云服务器提供商,新人活动买多久送多久,划算不套路!
Java编程中的HashSet和BitSet详解
我在Apache的开发邮件列表中发现一件很有趣的事,Apache Commons包的ArrayUtils类的removeElements方法,原先使用的HashSet现在换成了BitSet。
HashSettoRemove = new HashSet (); for (Map.Entry e : occurrences.entrySet()) { Character v = e.getKey(); int found = 0; for (int i = 0, ct = e.getValue().intValue(); i < ct; i++) { found = indexOf(array, v.charValue(), found); if (found < 0) { break; } toRemove.add(found++); } } return (char[]) removeAll((Object)array, extractIndices(toRemove));
文章标题:Java编程中的HashSet和BitSet详解-创新互联
文章起源:http://myzitong.com/article/dheged.html