--- old/src/java.base/share/classes/java/util/doc-files/coll-overview.html 2017-08-18 15:03:16.351040758 -0700 +++ new/src/java.base/share/classes/java/util/doc-files/coll-overview.html 2017-08-18 15:03:16.135031310 -0700 @@ -1,7 +1,4 @@ - - - + - - + + Collections Framework Overview +

Collections Framework Overview

@@ -73,7 +88,7 @@
  • General-purpose implementations. Primary implementations of the collection interfaces.
  • Legacy implementations. The collection classes -from earlier releases, Vector and Hashtable, were +from earlier releases, Vector and Hashtable, were retrofitted to implement the collection interfaces.
  • Special-purpose implementations. Implementations designed for use in special situations. These @@ -101,57 +116,57 @@

    Collection Interfaces

    The collection interfaces are divided into two groups. -The most basic interface, java.util.Collection, +The most basic interface, java.util.Collection, has the following descendants:

    -

    The other collection interfaces are based on java.util.Map and are +

    The other collection interfaces are based on java.util.Map and are not true collections. However, these interfaces contain collection-view operations, which enable them to be -manipulated as collections. Map has the following +manipulated as collections. Map has the following offspring:

    Many of the modification methods in the collection interfaces are labeled optional. Implementations are permitted to not perform one or more of these operations, throwing a runtime -exception (UnsupportedOperationException) if they are +exception (UnsupportedOperationException) if they are attempted. The documentation for each implementation must specify which optional operations are supported. Several terms are introduced to aid in this specification:

    Some implementations restrict what elements (or in the case of -Maps, keys and values) can be stored. Possible +Maps, keys and values) can be stored. Possible restrictions include requiring elements to:

    Attempting to add an element that violates an implementation's restrictions results in a runtime exception, typically a -ClassCastException, an IllegalArgumentException, -or a NullPointerException. Attempting to remove or test +ClassCastException, an IllegalArgumentException, +or a NullPointerException. Attempting to remove or test for the presence of an element that violates an implementation's restrictions can result in an exception. Some restricted collections permit this usage.

    -
    +

    Collection Implementations

    Classes that implement the collection interfaces typically have names in the form of <Implementation-style><Interface>. The general purpose implementations are summarized in the following table:

    - +
    + - - - - - - + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - +
    General purpose implementations
    InterfaceHash TableResizable ArrayBalanced TreeLinked ListHash Table + Linked ListInterfaceHash TableResizable ArrayBalanced TreeLinked ListHash Table + Linked List
    SetHashSet TreeSet LinkedHashSetSetHashSet TreeSet LinkedHashSet
    List ArrayList LinkedList List ArrayList LinkedList 
    Deque ArrayDeque LinkedList Deque ArrayDeque LinkedList 
    MapHashMap TreeMap LinkedHashMapMapHashMap TreeMap LinkedHashMap

    The general-purpose implementations support all of the optional operations in the collection interfaces and have no restrictions on the elements they may contain. They are -unsynchronized, but the Collections class contains static +unsynchronized, but the Collections class contains static factories called synchronization wrappers that can be used to add @@ -256,15 +264,15 @@ implementations have fail-fast iterators, which detect invalid concurrent modification, and fail quickly and cleanly (rather than behaving erratically).

    -

    The AbstractCollection, AbstractSet, -AbstractList, AbstractSequentialList and -AbstractMap classes provide basic implementations of the +

    The AbstractCollection, AbstractSet, +AbstractList, AbstractSequentialList and +AbstractMap classes provide basic implementations of the core collection interfaces, to minimize the effort required to implement them. The API documentation for these classes describes precisely how each method is implemented so the implementer knows which methods must be overridden, given the performance of the basic operations of a specific implementation.

    -
    +

    Concurrent Collections

    Applications that use collections from more than one thread must be carefully programmed. In general, this is known as concurrent @@ -279,47 +287,47 @@ in concurrent programming.

    These concurrent-aware interfaces are available:

    The following concurrent-aware implementation classes are available. See the API documentation for the correct usage of these implementations.

    -
    +

    Design Goals

    The main design goal was to produce an API that was small in size and, more importantly, in "conceptual weight." It @@ -332,7 +340,7 @@ not attempt to capture such subtle distinctions as mutability, modifiability, and resizability. Instead, certain calls in the core interfaces are optional, enabling implementations to throw -an UnsupportedOperationException to indicate that they do +an UnsupportedOperationException to indicate that they do not support a specified optional operation. Collection implementers must clearly document which optional operations are supported by an implementation.

    @@ -346,13 +354,13 @@

    It was critical that all reasonable representations of collections interoperate well. This included arrays, which cannot -be made to implement the Collection interface directly +be made to implement the Collection interface directly without changing the language. Thus, the framework includes methods to enable collections to be moved into arrays, arrays to be viewed as collections, and maps to be viewed as collections.

    -
    +

    -Copyright © 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
    +Copyright © 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
    Redwood Shores, CA 94065 USA. All rights reserved.