gembin

OSGi, Eclipse Equinox, ECF, Virgo, Gemini, Apache Felix, Karaf, Aires, Camel, Eclipse RCP

HBase, Hadoop, ZooKeeper, Cassandra

Flex4, AS3, Swiz framework, GraniteDS, BlazeDS etc.

There is nothing that software can't fix. Unfortunately, there is also nothing that software can't completely fuck up. That gap is called talent.

About Me

 

TreeSet vs HashSet vs LinkedHashSet

TreeSetHashSetLinkedHashSet
public class TreeSet
extends AbstractSet
implements SortedSetCloneableSerializable
public class HashSet
extends AbstractSet
implements SetCloneableSerializable
public class LinkedHashSet
extends HashSet
implements SetCloneableSerializable
unique valuesunique valuesUnique values
It stores its elements in a red-black treeIt stores its elements in a hash tableis implemented as a hash table with a linked list running through it
Order : ascending orderundefinedinsertion order
Performance : Slowbetter than LinkedHashSethas fast adding to the start of the list, and fast deletion from the interior via iteration
operations (addremove and contains)operations (addremovecontains and size)operations (addcontains and remove)
add, addAll,ceiling,clear,clone,comparator,contains,
descendingIterator,descendingSet,first,floor,
hashSet,higher,isEmpty,iterator,last,lower,pollFirst,
remove,size,subSet,tailSet
addclearclonecontainsisEmpty,iteratorremovesizeaddclearclonecontainsisEmpty,iteratorremovesize
From AbstractSet:
equalshashCoderemoveAll
equalshashCoderemoveAllequalshashCoderemoveAll
containsAllretainAlltoArraytoArray,toStringAbstractCollection:
addAllcontainsAllretainAlltoArray,toArraytoString
addAllcontainsAllretainAlltoArray,toArraytoString
Set:
containsAllequalshashCoderemoveAll,retainAlltoArraytoArray
addAllcontainsAllequalshashCode,removeAllretainAlltoArraytoArrayaddaddAllclearcontainscontainsAll,equalshashCodeisEmptyiteratorremove,removeAllretainAllsizetoArraytoArray

posted on 2012-03-31 11:30 gembin 阅读(488) 评论(0)  编辑  收藏 所属分类: JavaSE


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

常用链接

留言簿(6)

随笔分类(440)

随笔档案(378)

文章档案(6)

新闻档案(1)

相册

收藏夹(9)

Adobe

Android

AS3

Blog-Links

Build

Design Pattern

Eclipse

Favorite Links

Flickr

Game Dev

HBase

Identity Management

IT resources

JEE

Language

OpenID

OSGi

SOA

Version Control

最新随笔

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜

free counters