集合

2017-10-09  本文已影响0人  chenyq1989

集合

Java集合框架

Iterable
    Collection
        List
        Queue
            Deque
        Set
            SortedSet
                NavigableSet

Map
    SortedMap
        NavigableMap

Iterator
    ListIterator
RandomAccess

具体的集合

AbstractCollection
    AbstractList
        AbstractSequentialList
            LinkedList
        ArrayList
    AbstractSet
        HashSet
            LinkedHashSet
        EnumSet
        TreeSet
    AbstractQueue
        PriorityQueue
        ArrayQueue

AbstractMap
    HashMap
        LinkedHashMap
    TreeMap
    EnumMap
    WeakHashMap
    IdentityHashMap

映射

视图与包装器

Arrays.asList,Collections.nCopies,singleton

算法

Collections.sort,Collections.shuffle

Collections.binarySearch

replaceAll, min, max copy, fill, swap, reverse, rotate, removeIf...

removeAll, retainAll, addAll

toArray

方法的参数尽量使用接口而非具体的集合

遗留的集合

上一篇下一篇

猜你喜欢

热点阅读