Collection框架

1 常见接口和类

其中,矩形为接口,椭圆为类。

2 接口设计理由

比较显然的理由有:

1 元素是否可重复。分为List和Set。按此原则,Queue应该实现List。

2 能否随机访问,List分为ArrayList和LinkedList。

3 按无素是否有序。Set分为HashSet和SortedSet。

按是否线程安全。ArrayList -> Vector,Queue -> BlockingQueue,Deque -> BlockingDeque,

posted @ 2014-11-03 16:59  yanyichao  阅读(132)  评论(0编辑  收藏  举报