java集合类骨架图
2019-08-25 18:17:31 0 举报
集合框架骨架图
作者其他创作
大纲/内容
List
LinkedList具有ArrayList功能,也具有队列功能
+ size:int = 0+ first:Node-last:Node
- linkFirst(E e):void- linkLast(E e):void- unlink(E e):void
ArrayList
+ DEFAULT_CAPACITY:int = 10- modCount:transient int
+ ArrayList(int initialCapacity):ArrayList+ trimToSize():void+ + lastIndexOf(Object o):int
Collection
+ size():intadd(E e):boolean+ toArray():Object[]+ toArray(T[] a):T[]+ iterator():Iterator+ removeIf(Predicate<? super E> filter):boolean
AbstractSequentialList(顺序访问列表骨架实现)
+ iterator():Iterator<E>+ listIterator:(int index)
Queue(first-in-first-out)
+ add(E e):boolean+ offer(E e):boolean+ remove():void //移除头节点+ poll():E //移除头节点并返回+ elemen():E //遍历队列,返回头节点/为空抛异常+ peek():E //遍历队列,返回头节点,为空不抛异常
Iterable
+ iterator():Iterator- forEach(Consumer<? super T> action)- spliterator()Spliterator jdk8新增用来并行迭代集合工具
AbstractCollection
+ contains(Object o):boolean+ toArray(T[] a):T[] + remove():boolean+ clear():void
Deque(双端队列)即支持先进先出,也支持stack结构,后进先出
+ addFirst(E e):void+ addLast(E e):void+ offerFirst(E e):boolean //插入头节点+ offerLast(E e):boolean //插入尾部stack方法:push(E e):voidpop():E
AbstractList(随机访问列表骨架实现)
收藏
0 条评论
下一页