< prev index next >

src/java.base/share/classes/java/util/doc-files/coll-reference.html

Print this page


   1 <?xml version="1.0" encoding="utf-8"?>
   2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   3     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   4 
   5 <!--
   6  Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
   7  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   8 
   9  This code is free software; you can redistribute it and/or modify it
  10  under the terms of the GNU General Public License version 2 only, as
  11  published by the Free Software Foundation.  Oracle designates this
  12  particular file as subject to the "Classpath" exception as provided
  13  by Oracle in the LICENSE file that accompanied this code.
  14 
  15  This code is distributed in the hope that it will be useful, but WITHOUT
  16  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  17  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  18  version 2 for more details (a copy is included in the LICENSE file that
  19  accompanied this code).
  20 
  21  You should have received a copy of the GNU General Public License version
  22  2 along with this work; if not, write to the Free Software Foundation,
  23  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  24 
  25  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  26  or visit www.oracle.com if you need additional information or have any
  27  questions.
  28 -->
  29 
  30 <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang=
  31 "en-US">
  32 <head>
  33 <title>Outline of the Collections Framework</title>

  34 </head>
  35 <body>
  36 <h1>Outline of the Collections Framework</h1>
  37 <!-- Body text begins here -->
  38 The collections framework consists of:
  39 <ul>
  40 <li><strong>Collection interfaces</strong> - The primary means by
  41 which collections are manipulated.
  42 <ul>
  43 <li><a href=
  44 "../Collection.html"><strong>Collection</strong></a>
  45 - A group of objects. No assumptions are made about the order of
  46 the collection (if any) or whether it can contain duplicate
  47 elements.</li>
  48 <li><a href=
  49 "../Set.html"><strong>Set</strong></a> - The
  50 familiar set abstraction. No duplicate elements permitted. May or
  51 may not be ordered. Extends the <tt>Collection</tt> interface.</li>
  52 <li><a href=
  53 "../List.html"><strong>List</strong></a> -
  54 Ordered collection, also known as a <i>sequence</i>. Duplicates are
  55 generally permitted. Allows positional access. Extends the
  56 <tt>Collection</tt> interface.</li>
  57 <li><a href=
  58 "../Queue.html"><strong>Queue</strong></a> - A
  59 collection designed for holding elements before processing. Besides
  60 basic <tt>Collection</tt> operations, queues provide additional
  61 insertion, extraction, and inspection operations.</li>
  62 <li><a href=
  63 "../Deque.html"><strong>Deque</strong></a> - A
  64 <em>double ended queue</em>, supporting element insertion and
  65 removal at both ends. Extends the <tt>Queue</tt> interface.</li>
  66 <li><a href=
  67 "../Map.html"><strong>Map</strong></a> - A
  68 mapping from keys to values. Each key can map to one value.</li>
  69 <li><a href=
  70 "../SortedSet.html"><strong>SortedSet</strong></a>
  71 - A set whose elements are automatically sorted, either in their
  72 <i>natural ordering</i> (see the <a href=
  73 "../../lang/Comparable.html"><tt>Comparable</tt></a>
  74 interface) or by a <a href=
  75 "../Comparator.html"><tt>Comparator</tt></a>
  76 object provided when a <tt>SortedSet</tt> instance is created.
  77 Extends the <tt>Set</tt> interface.</li>
  78 <li><a href=
  79 "../SortedMap.html"><strong>SortedMap</strong></a>
  80 - A map whose mappings are automatically sorted by key, either
  81 using the <i>natural ordering</i> of the keys or by a comparator
  82 provided when a <tt>SortedMap</tt> instance is created. Extends the
  83 <tt>Map</tt> interface.</li>
  84 <li><a href=
  85 "../NavigableSet.html"><strong>NavigableSet</strong></a>
  86 - A <tt>SortedSet</tt> extended with navigation methods reporting
  87 closest matches for given search targets. A <tt>NavigableSet</tt>
  88 may be accessed and traversed in either ascending or descending
  89 order.</li>
  90 <li><a href=
  91 "../NavigableMap.html"><strong>NavigableMap</strong></a>
  92 - A <tt>SortedMap</tt> extended with navigation methods returning
  93 the closest matches for given search targets. A
  94 <tt>NavigableMap</tt> can be accessed and traversed in either
  95 ascending or descending key order.</li>
  96 <li><a href=
  97 "../concurrent/BlockingQueue.html"><strong>BlockingQueue</strong></a>
  98 - A <tt>Queue</tt> with operations that wait for the queue to
  99 become nonempty when retrieving an element and that wait for space
 100 to become available in the queue when storing an element. (This
 101 interface is part of the <tt><a href=
 102 "../concurrent/package-summary.html">java.util.concurrent</a></tt>
 103 package.)</li>
 104 <li><a href=
 105 "../concurrent/TransferQueue.html"><strong>TransferQueue</strong></a>
 106 - A <tt>BlockingQueue</tt> in which producers can wait for
 107 consumers to receive elements. (This interface is part of the
 108 <tt><a href=
 109 "../concurrent/package-summary.html">java.util.concurrent</a></tt>
 110 package.)</li>
 111 <li><a href=
 112 "../concurrent/BlockingDeque.html"><strong>BlockingDeque</strong></a>
 113 - A <tt>Deque</tt> with operations that wait for the deque to
 114 become nonempty when retrieving an element and wait for space to
 115 become available in the deque when storing an element. Extends both
 116 the <tt>Deque</tt> and <tt>BlockingQueue</tt> interfaces. (This
 117 interface is part of the <tt><a href=
 118 "../concurrent/package-summary.html">java.util.concurrent</a></tt>
 119 package.)</li>
 120 <li><a href=
 121 "../concurrent/ConcurrentMap.html"><strong>ConcurrentMap</strong></a>
 122 - A <tt>Map</tt> with atomic <tt>putIfAbsent</tt>, <tt>remove</tt>,
 123 and <tt>replace</tt> methods. (This interface is part of the
 124 <tt>java.util.concurrent</tt> package.)</li>
 125 <li><a href=
 126 "../concurrent/ConcurrentNavigableMap.html"><strong>
 127 ConcurrentNavigableMap</strong></a> - A <tt>ConcurrentMap</tt> that
 128 is also a <tt>NavigableMap</tt>.</li>
 129 </ul>
 130 </li>
 131 <li><strong>General-purpose implementations</strong> - The primary
 132 implementations of the collection interfaces.
 133 <ul>
 134 <li><strong><a href=
 135 "../HashSet.html">HashSet</a></strong> - Hash
 136 table implementation of the <tt>Set</tt> interface. The best
 137 all-around implementation of the <tt>Set</tt> interface.</li>
 138 <li><a href=
 139 "../TreeSet.html"><strong>TreeSet</strong></a>
 140 - Red-black tree implementation of the <tt>NavigableSet</tt>
 141 interface.</li>
 142 <li><strong><a href=
 143 "../LinkedHashSet.html">LinkedHashSet</a></strong>
 144 - Hash table and linked list implementation of the <tt>Set</tt>
 145 interface. An insertion-ordered <tt>Set</tt> implementation that
 146 runs nearly as fast as <tt>HashSet</tt>.</li>
 147 <li><strong><a href=
 148 "../ArrayList.html">ArrayList</a></strong> -
 149 Resizable array implementation of the <tt>List</tt> interface (an
 150 unsynchronized <tt>Vector</tt>). The best all-around implementation
 151 of the <tt>List</tt> interface.</li>
 152 <li><strong><a href=
 153 "../ArrayDeque.html">ArrayDeque</a></strong> -
 154 Efficient, resizable array implementation of the <tt>Deque</tt>
 155 interface.</li>
 156 <li><a href=
 157 "../LinkedList.html"><strong>LinkedList</strong></a>
 158 - Doubly-linked list implementation of the <tt>List</tt> interface.
 159 Provides better performance than the <tt>ArrayList</tt>
 160 implementation if elements are frequently inserted or deleted
 161 within the list. Also implements the <tt>Deque</tt> interface. When
 162 accessed through the <tt>Queue</tt> interface, <tt>LinkedList</tt>
 163 acts as a FIFO queue.</li>
 164 <li><strong><a href=
 165 "../PriorityQueue.html">PriorityQueue</a></strong>
 166 - Heap implementation of an unbounded priority queue.</li>
 167 <li><strong><a href=
 168 "../HashMap.html">HashMap</a></strong> - Hash
 169 table implementation of the <tt>Map</tt> interface (an
 170 unsynchronized <tt>Hashtable</tt> that supports <tt>null</tt> keys
 171 and values). The best all-around implementation of the <tt>Map</tt>
 172 interface.</li>
 173 <li><a href=
 174 "../TreeMap.html"><strong>TreeMap</strong></a>
 175 Red-black tree implementation of the <tt>NavigableMap</tt>
 176 interface.</li>
 177 <li><strong><a href=
 178 "../LinkedHashMap.html">LinkedHashMap</a></strong>
 179 - Hash table and linked list implementation of the <tt>Map</tt>
 180 interface. An insertion-ordered <tt>Map</tt> implementation that
 181 runs nearly as fast as <tt>HashMap</tt>. Also useful for building
 182 caches (see <a href=
 183 "../LinkedHashMap.html#removeEldestEntry-java.util.Map.Entry-">
 184 removeEldestEntry(Map.Entry)</a> ).</li>
 185 </ul>
 186 </li>
 187 <li><strong>Wrapper implementations</strong> -
 188 Functionality-enhancing implementations for use with other
 189 implementations. Accessed solely through static factory methods.
 190 <ul>
 191 <li><a href=
 192 "../Collections.html#unmodifiableCollection-java.util.Collection-">
 193 <strong>Collections.unmodifiable<i>Interface</i></strong></a> -
 194 Returns an unmodifiable view of a specified collection that throws
 195 an <tt>UnsupportedOperationException</tt> if the user attempts to
 196 modify it.</li>
 197 <li><a name="synchWrappers" href=
 198 "../Collections.html#synchronizedCollection-java.util.Collection-"
 199 id=
 200 "synchWrappers"><strong>Collections.synchronized<i>Interface</i></strong></a>
 201 - Returns a synchronized collection that is backed by the specified
 202 (typically unsynchronized) collection. As long as all accesses to
 203 the backing collection are through the returned collection, thread
 204 safety is guaranteed.</li>
 205 <li><a href=
 206 "../Collections.html#checkedCollection-java.util.Collection-java.lang.Class-">
 207 <strong>Collections.checked<i>Interface</i></strong></a> - Returns
 208 a dynamically type-safe view of the specified collection, which
 209 throws a <tt>ClassCastException</tt> if a client attempts to add an
 210 element of the wrong type. The generics mechanism in the language
 211 provides compile-time (static) type checking, but it is possible to
 212 bypass this mechanism. Dynamically type-safe views eliminate this
 213 possibility.</li>
 214 </ul>
 215 </li>
 216 <li><strong>Adapter implementations</strong> - Implementations that
 217 adapt one collections interface to another:
 218 <ul>
 219 <li><strong><a href=
 220 "../Collections.html#newSetFromMap-java.util.Map-">
 221 newSetFromMap(Map)</a></strong> - Creates a general-purpose
 222 <tt>Set</tt> implementation from a general-purpose <tt>Map</tt>
 223 implementation.</li>
 224 <li><strong><a href=
 225 "../Collections.html#asLifoQueue-java.util.Deque-">
 226 asLifoQueue(Deque)</a></strong> - Returns a view of a
 227 <tt>Deque</tt> as a Last In First Out (LIFO) <tt>Queue</tt>.</li>
 228 </ul>
 229 </li>
 230 <li><strong>Convenience implementations</strong> - High-performance
 231 "mini-implementations" of the collection interfaces.
 232 <ul>
 233 <li><a href=
 234 "../Arrays.html#asList-T...-"><strong>Arrays.asList</strong></a>
 235 - Enables an array to be viewed as a list.</li>
 236 <li><strong><a href=
 237 "../Collections.html#emptySet--">emptySet</a>,
 238 <a href=
 239 "../Collections.html#emptyList--">emptyList</a>
 240 and <a href=
 241 "../Collections.html#emptyMap--">emptyMap</a></strong>
 242 - Return an immutable empty set, list, or map.</li>
 243 <li><strong><a href=
 244 "../Collections.html#singleton-java.lang.Object-">
 245 singleton</a>, <a href=
 246 "../Collections.html#singletonList-java.lang.Object-">
 247 singletonList</a>, and <a href=
 248 "../Collections.html#singletonMap-K-V-">singletonMap</a></strong>
 249 - Return an immutable singleton set, list, or map, containing only
 250 the specified object (or key-value mapping).</li>
 251 <li><a href=
 252 "../Collections.html#nCopies-int-T-"><strong>
 253 nCopies</strong></a> - Returns an immutable list consisting of n
 254 copies of a specified object.</li>
 255 </ul>
 256 </li>
 257 <li><strong>Legacy implementations</strong> - Older collection
 258 classes were retrofitted to implement the collection interfaces.
 259 <ul>
 260 <li><a href=
 261 "../Vector.html"><strong>Vector</strong></a> -
 262 Synchronized resizable array implementation of the <tt>List</tt>
 263 interface with additional legacy methods.</li>
 264 <li><a href=
 265 "../Hashtable.html"><strong>Hashtable</strong></a>
 266 - Synchronized hash table implementation of the <tt>Map</tt>
 267 interface that does not allow <tt>null</tt> keys or values, plus
 268 additional legacy methods.</li>
 269 </ul>
 270 </li>
 271 <li><strong>Special-purpose implementations</strong>
 272 <ul>
 273 <li><strong><a href=
 274 "../WeakHashMap.html">WeakHashMap</a></strong>
 275 - An implementation of the <tt>Map</tt> interface that stores only
 276 <a href="../../lang/ref/WeakReference.html"><i>weak
 277 references</i></a> to its keys. Storing only weak references
 278 enables key-value pairs to be garbage collected when the key is no
 279 longer referenced outside of the <tt>WeakHashMap</tt>. This class
 280 is the easiest way to use the power of weak references. It is
 281 useful for implementing registry-like data structures, where the
 282 utility of an entry vanishes when its key is no longer reachable by
 283 any thread.</li>
 284 <li><strong><a href=
 285 "../IdentityHashMap.html">IdentityHashMap</a></strong>
 286 - Identity-based <tt>Map</tt> implementation based on a hash table.
 287 This class is useful for topology-preserving object graph
 288 transformations (such as serialization or deep copying). To perform
 289 these transformations, you must maintain an identity-based "node
 290 table" that keeps track of which objects have already been seen.
 291 Identity-based maps are also used to maintain
 292 object-to-meta-information mappings in dynamic debuggers and
 293 similar systems. Finally, identity-based maps are useful in
 294 preventing "spoof attacks" resulting from intentionally perverse
 295 equals methods. (<tt>IdentityHashMap</tt> never invokes the equals
 296 method on its keys.) An added benefit of this implementation is
 297 that it is fast.</li>
 298 <li><strong><a href=
 299 "../concurrent/CopyOnWriteArrayList.html">CopyOnWriteArrayList</a></strong>
 300 - A <tt>List</tt> implementation backed by an copy-on-write array.
 301 All mutative operations (such as <tt>add</tt>, <tt>set</tt>, and
 302 <tt>remove</tt>) are implemented by making a new copy of the array.
 303 No synchronization is necessary, even during iteration, and
 304 iterators are guaranteed never to throw
 305 <tt>ConcurrentModificationException</tt>. This implementation is
 306 well-suited to maintaining event-handler lists (where change is
 307 infrequent, and traversal is frequent and potentially
 308 time-consuming).</li>
 309 <li><strong><a href=
 310 "../concurrent/CopyOnWriteArraySet.html">CopyOnWriteArraySet</a></strong>
 311 - A <tt>Set</tt> implementation backed by a copy-on-write array.
 312 This implementation is similar to <tt>CopyOnWriteArrayList</tt>.
 313 Unlike most <tt>Set</tt> implementations, the <tt>add</tt>,
 314 <tt>remove</tt>, and <tt>contains</tt> methods require time
 315 proportional to the size of the set. This implementation is well
 316 suited to maintaining event-handler lists that must prevent
 317 duplicates.</li>
 318 <li><strong><a href=
 319 "../EnumSet.html">EnumSet</a></strong> - A
 320 high-performance <tt>Set</tt> implementation backed by a bit
 321 vector. All elements of each <tt>EnumSet</tt> instance must be
 322 elements of a single enum type.</li>
 323 <li><strong><a href=
 324 "../EnumMap.html">EnumMap</a></strong> - A
 325 high-performance <tt>Map</tt> implementation backed by an array.
 326 All keys in each <tt>EnumMap</tt> instance must be elements of a
 327 single enum type.</li>
 328 </ul>
 329 </li>
 330 <li><strong>Concurrent implementations</strong> - These
 331 implementations are part of <tt>java.util.concurrent</tt>.
 332 <ul>
 333 <li><strong><a href=
 334 "../concurrent/ConcurrentLinkedQueue.html">ConcurrentLinkedQueue</a></strong>
 335 - An unbounded first in, first out (FIFO) queue based on linked
 336 nodes.</li>
 337 <li><a href=
 338 "../concurrent/LinkedBlockingQueue.html"><strong>
 339 LinkedBlockingQueue</strong></a> - An optionally bounded FIFO
 340 blocking queue backed by linked nodes.</li>
 341 <li><a href=
 342 "../concurrent/ArrayBlockingQueue.html"><strong>
 343 ArrayBlockingQueue</strong></a> - A bounded FIFO blocking queue
 344 backed by an array.</li>
 345 <li><a href=
 346 "../concurrent/PriorityBlockingQueue.html"><strong>
 347 PriorityBlockingQueue</strong></a> - An unbounded blocking priority
 348 queue backed by a priority heap.</li>
 349 <li><a href=
 350 "../concurrent/DelayQueue.html"><strong>DelayQueue</strong></a>
 351 - A time-based scheduling queue backed by a priority heap.</li>
 352 <li><a href=
 353 "../concurrent/SynchronousQueue.html"><strong>SynchronousQueue</strong></a>
 354 - A simple rendezvous mechanism that uses the
 355 <tt>BlockingQueue</tt> interface.</li>
 356 <li><a href=
 357 "../concurrent/LinkedBlockingDeque.html"><strong>
 358 LinkedBlockingDeque</strong></a> - An optionally bounded FIFO
 359 blocking deque backed by linked nodes.</li>
 360 <li><a href=
 361 "../concurrent/LinkedTransferQueue.html"><strong>
 362 LinkedTransferQueue</strong></a> - An unbounded
 363 <tt>TransferQueue</tt> backed by linked nodes.</li>
 364 <li><a href=
 365 "../concurrent/ConcurrentHashMap.html"><strong>ConcurrentHashMap</strong></a>
 366 - A highly concurrent, high-performance <tt>ConcurrentMap</tt>
 367 implementation based on a hash table. This implementation never
 368 blocks when performing retrievals and enables the client to select
 369 the concurrency level for updates. It is intended as a drop-in
 370 replacement for <tt><a href=
 371 "../Hashtable.html">Hashtable</a></tt>. In
 372 addition to implementing <tt>ConcurrentMap</tt>, it supports all of
 373 the legacy methods of <tt>Hashtable</tt>.</li>
 374 <li><a href=
 375 "../concurrent/ConcurrentSkipListSet.html"><strong>
 376 ConcurrentSkipListSet</strong></a> - Skips list implementation of
 377 the <tt>NavigableSet</tt> interface.</li>
 378 <li><a href=
 379 "../concurrent/ConcurrentSkipListMap.html"><strong>
 380 ConcurrentSkipListMap</strong></a> - Skips list implementation of
 381 the <tt>ConcurrentNavigableMap</tt> interface.</li>
 382 </ul>
 383 </li>
 384 <li><strong>Abstract implementations</strong> - Skeletal
 385 implementations of the collection interfaces to facilitate custom
 386 implementations.
 387 <ul>
 388 <li><a href=
 389 "../AbstractCollection.html"><strong>AbstractCollection</strong></a>
 390 - Skeletal <tt>Collection</tt> implementation that is neither a set
 391 nor a list (such as a "bag" or multiset).</li>
 392 <li><a href=
 393 "../AbstractSet.html"><strong>AbstractSet</strong></a>
 394 - Skeletal <tt>Set</tt> implementation.</li>
 395 <li><a href=
 396 "../AbstractList.html"><strong>AbstractList</strong></a>
 397 - Skeletal <tt>List</tt> implementation backed by a random access
 398 data store (such as an array).</li>
 399 <li><a href=
 400 "../AbstractSequentialList.html"><strong>AbstractSequentialList</strong></a>
 401 - Skeletal <tt>List</tt> implementation backed by a sequential
 402 access data store (such as a linked list).</li>
 403 <li><a href=
 404 "../AbstractQueue.html"><strong>AbstractQueue</strong></a>
 405 - Skeletal <tt>Queue</tt> implementation.</li>
 406 <li><a href=
 407 "../AbstractMap.html"><strong>AbstractMap</strong></a>
 408 - Skeletal <tt>Map</tt> implementation.</li>
 409 </ul>
 410 </li>
 411 <li><strong>Algorithms</strong> - The <a href=
 412 "../Collections.html"><strong>Collections</strong></a>
 413 class contains these useful static methods.
 414 <ul>
 415 <li><strong><a href=
 416 "../Collections.html#sort-java.util.List-">sort(List)</a></strong>
 417 - Sorts a list using a merge sort algorithm, which provides average
 418 case performance comparable to a high quality quicksort, guaranteed
 419 O(n*log n) performance (unlike quicksort), and <em>stability</em>
 420 (unlike quicksort). A stable sort is one that does not reorder
 421 equal elements.</li>
 422 <li><strong><a href=
 423 "../Collections.html#binarySearch-java.util.List-T-">
 424 binarySearch(List, Object)</a></strong> - Searches for an element
 425 in an ordered list using the binary search algorithm.</li>
 426 <li><strong><a href=
 427 "../Collections.html#reverse-java.util.List-">reverse(List)</a></strong>
 428 - Reverses the order of the elements in a list.</li>


 474 <li><strong><a href=
 475 "../Collections.html#disjoint-java.util.Collection-java.util.Collection-">
 476 disjoint(Collection, Collection)</a></strong> - Determines whether
 477 two collections are disjoint, in other words, whether they contain
 478 no elements in common.</li>
 479 <li><strong><a href=
 480 "../Collections.html#addAll-java.util.Collection-T...-">
 481 addAll(Collection&lt;? super T&gt;, T...)</a></strong> - Adds all
 482 of the elements in the specified array to the specified
 483 collection.</li>
 484 </ul>
 485 </li>
 486 <li><strong>Infrastructure</strong>
 487 <ul>
 488 <li><strong>Iterators</strong> - Similar to the familiar <a href=
 489 "../Enumeration.html">Enumeration</a>
 490 interface, but more powerful, and with improved method names.
 491 <ul>
 492 <li><a href=
 493 "../Iterator.html"><strong>Iterator</strong></a>
 494 - In addition to the functionality of the <tt>Enumeration</tt>
 495 interface, enables the user to remove elements from the backing
 496 collection with well-defined, useful semantics.</li>
 497 <li><a href=
 498 "../ListIterator.html"><strong>ListIterator</strong></a>
 499 - Iterator for use with lists. In addition to the functionality of
 500 the <tt>Iterator</tt> interface, supports bidirectional iteration,
 501 element replacement, element insertion, and index retrieval.</li>
 502 </ul>
 503 </li>
 504 <li><strong>Ordering</strong>
 505 <ul>
 506 <li><a href=
 507 "../../lang/Comparable.html"><strong>Comparable</strong></a>
 508 - Imparts a <i>natural ordering</i> to classes that implement it.
 509 The natural ordering can be used to sort a list or maintain order
 510 in a sorted set or map. Many classes were retrofitted to implement
 511 this interface.</li>
 512 <li><a href=
 513 "../Comparator.html"><strong>Comparator</strong></a>
 514 - Represents an order relation, which can be used to sort a list or
 515 maintain order in a sorted set or map. Can override a type's
 516 natural ordering or order objects of a type that does not implement
 517 the <tt>Comparable</tt> interface.</li>
 518 </ul>
 519 </li>
 520 <li><strong>Runtime exceptions</strong>
 521 <ul>
 522 <li><a href=
 523 "../../lang/UnsupportedOperationException.html"><strong>
 524 UnsupportedOperationException</strong></a> - Thrown by collections
 525 if an unsupported optional operation is called.</li>
 526 <li><a href=
 527 "../ConcurrentModificationException.html"><strong>
 528 ConcurrentModificationException</strong></a> - Thrown by iterators
 529 and list iterators if the backing collection is changed
 530 unexpectedly while the iteration is in progress. Also thrown by
 531 <i>sublist</i> views of lists if the backing list is changed
 532 unexpectedly.</li>
 533 </ul>
 534 </li>
 535 <li><strong>Performance</strong>
 536 <ul>
 537 <li><strong><a href=
 538 "../RandomAccess.html">RandomAccess</a></strong>
 539 - Marker interface that lets <tt>List</tt> implementations indicate
 540 that they support fast (generally constant time) random access.
 541 This lets generic algorithms change their behavior to provide good
 542 performance when applied to either random or sequential access
 543 lists.</li>
 544 </ul>
 545 </li>
 546 </ul>
 547 </li>
 548 <li><strong>Array Utilities</strong>
 549 <ul>
 550 <li><a href=
 551 "../Arrays.html"><strong>Arrays</strong></a> -
 552 Contains static methods to sort, search, compare, hash, copy,
 553 resize, convert to <tt>String</tt>, and fill arrays of primitives
 554 and objects.</li>
 555 </ul>
 556 </li>
 557 </ul>
 558 <hr />
 559 <p style="font-size:smaller">
 560 Copyright &copy; 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br />
 561     Redwood Shores, CA 94065 USA. All rights reserved.</p>
 562 <!-- Body text ends here -->
 563 </body>
 564 </html>
   1 <!DOCTYPE html>



   2 <!--
   3  Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
   4  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5 
   6  This code is free software; you can redistribute it and/or modify it
   7  under the terms of the GNU General Public License version 2 only, as
   8  published by the Free Software Foundation.  Oracle designates this
   9  particular file as subject to the "Classpath" exception as provided
  10  by Oracle in the LICENSE file that accompanied this code.
  11 
  12  This code is distributed in the hope that it will be useful, but WITHOUT
  13  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  version 2 for more details (a copy is included in the LICENSE file that
  16  accompanied this code).
  17 
  18  You should have received a copy of the GNU General Public License version
  19  2 along with this work; if not, write to the Free Software Foundation,
  20  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21 
  22  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23  or visit www.oracle.com if you need additional information or have any
  24  questions.
  25 -->
  26 
  27 <html lang="en-US">

  28 <head>
  29 <title>Outline of the Collections Framework</title>
  30 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  31 </head>
  32 <body>
  33 <h1>Outline of the Collections Framework</h1>
  34 <!-- Body text begins here -->
  35 The collections framework consists of:
  36 <ul>
  37 <li><strong>Collection interfaces</strong> - The primary means by
  38 which collections are manipulated.
  39 <ul>
  40 <li><a href=
  41 "../Collection.html"><strong>Collection</strong></a>
  42 - A group of objects. No assumptions are made about the order of
  43 the collection (if any) or whether it can contain duplicate
  44 elements.</li>
  45 <li><a href=
  46 "../Set.html"><strong>Set</strong></a> - The
  47 familiar set abstraction. No duplicate elements permitted. May or
  48 may not be ordered. Extends the <code>Collection</code> interface.</li>
  49 <li><a href=
  50 "../List.html"><strong>List</strong></a> -
  51 Ordered collection, also known as a <i>sequence</i>. Duplicates are
  52 generally permitted. Allows positional access. Extends the
  53 <code>Collection</code> interface.</li>
  54 <li><a href=
  55 "../Queue.html"><strong>Queue</strong></a> - A
  56 collection designed for holding elements before processing. Besides
  57 basic <code>Collection</code> operations, queues provide additional
  58 insertion, extraction, and inspection operations.</li>
  59 <li><a href=
  60 "../Deque.html"><strong>Deque</strong></a> - A
  61 <em>double ended queue</em>, supporting element insertion and
  62 removal at both ends. Extends the <code>Queue</code> interface.</li>
  63 <li><a href=
  64 "../Map.html"><strong>Map</strong></a> - A
  65 mapping from keys to values. Each key can map to one value.</li>
  66 <li><a href=
  67 "../SortedSet.html"><strong>SortedSet</strong></a>
  68 - A set whose elements are automatically sorted, either in their
  69 <i>natural ordering</i> (see the <a href=
  70 "../../lang/Comparable.html"><code>Comparable</code></a>
  71 interface) or by a <a href=
  72 "../Comparator.html"><code>Comparator</code></a>
  73 object provided when a <code>SortedSet</code> instance is created.
  74 Extends the <code>Set</code> interface.</li>
  75 <li><a href=
  76 "../SortedMap.html"><strong>SortedMap</strong></a>
  77 - A map whose mappings are automatically sorted by key, either
  78 using the <i>natural ordering</i> of the keys or by a comparator
  79 provided when a <code>SortedMap</code> instance is created. Extends the
  80 <code>Map</code> interface.</li>
  81 <li><a href=
  82 "../NavigableSet.html"><strong>NavigableSet</strong></a>
  83 - A <code>SortedSet</code> extended with navigation methods reporting
  84 closest matches for given search targets. A <code>NavigableSet</code>
  85 may be accessed and traversed in either ascending or descending
  86 order.</li>
  87 <li><a href=
  88 "../NavigableMap.html"><strong>NavigableMap</strong></a>
  89 - A <code>SortedMap</code> extended with navigation methods returning
  90 the closest matches for given search targets. A
  91 <code>NavigableMap</code> can be accessed and traversed in either
  92 ascending or descending key order.</li>
  93 <li><a href=
  94 "../concurrent/BlockingQueue.html"><strong>BlockingQueue</strong></a>
  95 - A <code>Queue</code> with operations that wait for the queue to
  96 become nonempty when retrieving an element and that wait for space
  97 to become available in the queue when storing an element. (This
  98 interface is part of the <code><a href=
  99 "../concurrent/package-summary.html">java.util.concurrent</a></code>
 100 package.)</li>
 101 <li><a href=
 102 "../concurrent/TransferQueue.html"><strong>TransferQueue</strong></a>
 103 - A <code>BlockingQueue</code> in which producers can wait for
 104 consumers to receive elements. (This interface is part of the
 105 <code><a href=
 106 "../concurrent/package-summary.html">java.util.concurrent</a></code>
 107 package.)</li>
 108 <li><a href=
 109 "../concurrent/BlockingDeque.html"><strong>BlockingDeque</strong></a>
 110 - A <code>Deque</code> with operations that wait for the deque to
 111 become nonempty when retrieving an element and wait for space to
 112 become available in the deque when storing an element. Extends both
 113 the <code>Deque</code> and <code>BlockingQueue</code> interfaces. (This
 114 interface is part of the <code><a href=
 115 "../concurrent/package-summary.html">java.util.concurrent</a></code>
 116 package.)</li>
 117 <li><a href=
 118 "../concurrent/ConcurrentMap.html"><strong>ConcurrentMap</strong></a>
 119 - A <code>Map</code> with atomic <code>putIfAbsent</code>, <code>remove</code>,
 120 and <code>replace</code> methods. (This interface is part of the
 121 <code>java.util.concurrent</code> package.)</li>
 122 <li><a href=
 123 "../concurrent/ConcurrentNavigableMap.html"><strong>
 124 ConcurrentNavigableMap</strong></a> - A <code>ConcurrentMap</code> that
 125 is also a <code>NavigableMap</code>.</li>
 126 </ul>
 127 </li>
 128 <li><strong>General-purpose implementations</strong> - The primary
 129 implementations of the collection interfaces.
 130 <ul>
 131 <li><strong><a href=
 132 "../HashSet.html">HashSet</a></strong> - Hash
 133 table implementation of the <code>Set</code> interface. The best
 134 all-around implementation of the <code>Set</code> interface.</li>
 135 <li><a href=
 136 "../TreeSet.html"><strong>TreeSet</strong></a>
 137 - Red-black tree implementation of the <code>NavigableSet</code>
 138 interface.</li>
 139 <li><strong><a href=
 140 "../LinkedHashSet.html">LinkedHashSet</a></strong>
 141 - Hash table and linked list implementation of the <code>Set</code>
 142 interface. An insertion-ordered <code>Set</code> implementation that
 143 runs nearly as fast as <code>HashSet</code>.</li>
 144 <li><strong><a href=
 145 "../ArrayList.html">ArrayList</a></strong> -
 146 Resizable array implementation of the <code>List</code> interface (an
 147 unsynchronized <code>Vector</code>). The best all-around implementation
 148 of the <code>List</code> interface.</li>
 149 <li><strong><a href=
 150 "../ArrayDeque.html">ArrayDeque</a></strong> -
 151 Efficient, resizable array implementation of the <code>Deque</code>
 152 interface.</li>
 153 <li><a href=
 154 "../LinkedList.html"><strong>LinkedList</strong></a>
 155 - Doubly-linked list implementation of the <code>List</code> interface.
 156 Provides better performance than the <code>ArrayList</code>
 157 implementation if elements are frequently inserted or deleted
 158 within the list. Also implements the <code>Deque</code> interface. When
 159 accessed through the <code>Queue</code> interface, <code>LinkedList</code>
 160 acts as a FIFO queue.</li>
 161 <li><strong><a href=
 162 "../PriorityQueue.html">PriorityQueue</a></strong>
 163 - Heap implementation of an unbounded priority queue.</li>
 164 <li><strong><a href=
 165 "../HashMap.html">HashMap</a></strong> - Hash
 166 table implementation of the <code>Map</code> interface (an
 167 unsynchronized <code>Hashtable</code> that supports <code>null</code> keys
 168 and values). The best all-around implementation of the <code>Map</code>
 169 interface.</li>
 170 <li><a href=
 171 "../TreeMap.html"><strong>TreeMap</strong></a>
 172 Red-black tree implementation of the <code>NavigableMap</code>
 173 interface.</li>
 174 <li><strong><a href=
 175 "../LinkedHashMap.html">LinkedHashMap</a></strong>
 176 - Hash table and linked list implementation of the <code>Map</code>
 177 interface. An insertion-ordered <code>Map</code> implementation that
 178 runs nearly as fast as <code>HashMap</code>. Also useful for building
 179 caches (see <a href=
 180 "../LinkedHashMap.html#removeEldestEntry-java.util.Map.Entry-">
 181 removeEldestEntry(Map.Entry)</a> ).</li>
 182 </ul>
 183 </li>
 184 <li><strong>Wrapper implementations</strong> -
 185 Functionality-enhancing implementations for use with other
 186 implementations. Accessed solely through static factory methods.
 187 <ul>
 188 <li><a href=
 189 "../Collections.html#unmodifiableCollection-java.util.Collection-">
 190 <strong>Collections.unmodifiable<i>Interface</i></strong></a> -
 191 Returns an unmodifiable view of a specified collection that throws
 192 an <code>UnsupportedOperationException</code> if the user attempts to
 193 modify it.</li>
 194 <li><a href=
 195 "../Collections.html#synchronizedCollection-java.util.Collection-"
 196 id=
 197 "synchWrappers"><strong>Collections.synchronized<i>Interface</i></strong></a>
 198 - Returns a synchronized collection that is backed by the specified
 199 (typically unsynchronized) collection. As long as all accesses to
 200 the backing collection are through the returned collection, thread
 201 safety is guaranteed.</li>
 202 <li><a href=
 203 "../Collections.html#checkedCollection-java.util.Collection-java.lang.Class-">
 204 <strong>Collections.checked<i>Interface</i></strong></a> - Returns
 205 a dynamically type-safe view of the specified collection, which
 206 throws a <code>ClassCastException</code> if a client attempts to add an
 207 element of the wrong type. The generics mechanism in the language
 208 provides compile-time (static) type checking, but it is possible to
 209 bypass this mechanism. Dynamically type-safe views eliminate this
 210 possibility.</li>
 211 </ul>
 212 </li>
 213 <li><strong>Adapter implementations</strong> - Implementations that
 214 adapt one collections interface to another:
 215 <ul>
 216 <li><strong><a href=
 217 "../Collections.html#newSetFromMap-java.util.Map-">
 218 newSetFromMap(Map)</a></strong> - Creates a general-purpose
 219 <code>Set</code> implementation from a general-purpose <code>Map</code>
 220 implementation.</li>
 221 <li><strong><a href=
 222 "../Collections.html#asLifoQueue-java.util.Deque-">
 223 asLifoQueue(Deque)</a></strong> - Returns a view of a
 224 <code>Deque</code> as a Last In First Out (LIFO) <code>Queue</code>.</li>
 225 </ul>
 226 </li>
 227 <li><strong>Convenience implementations</strong> - High-performance
 228 "mini-implementations" of the collection interfaces.
 229 <ul>
 230 <li><a href=
 231 "../Arrays.html#asList-T...-"><strong>Arrays.asList</strong></a>
 232 - Enables an array to be viewed as a list.</li>
 233 <li><strong><a href=
 234 "../Collections.html#emptySet--">emptySet</a>,
 235 <a href=
 236 "../Collections.html#emptyList--">emptyList</a>
 237 and <a href=
 238 "../Collections.html#emptyMap--">emptyMap</a></strong>
 239 - Return an immutable empty set, list, or map.</li>
 240 <li><strong><a href=
 241 "../Collections.html#singleton-java.lang.Object-">
 242 singleton</a>, <a href=
 243 "../Collections.html#singletonList-java.lang.Object-">
 244 singletonList</a>, and <a href=
 245 "../Collections.html#singletonMap-K-V-">singletonMap</a></strong>
 246 - Return an immutable singleton set, list, or map, containing only
 247 the specified object (or key-value mapping).</li>
 248 <li><a href=
 249 "../Collections.html#nCopies-int-T-"><strong>
 250 nCopies</strong></a> - Returns an immutable list consisting of n
 251 copies of a specified object.</li>
 252 </ul>
 253 </li>
 254 <li><strong>Legacy implementations</strong> - Older collection
 255 classes were retrofitted to implement the collection interfaces.
 256 <ul>
 257 <li><a href=
 258 "../Vector.html"><strong>Vector</strong></a> -
 259 Synchronized resizable array implementation of the <code>List</code>
 260 interface with additional legacy methods.</li>
 261 <li><a href=
 262 "../Hashtable.html"><strong>Hashtable</strong></a>
 263 - Synchronized hash table implementation of the <code>Map</code>
 264 interface that does not allow <code>null</code> keys or values, plus
 265 additional legacy methods.</li>
 266 </ul>
 267 </li>
 268 <li><strong>Special-purpose implementations</strong>
 269 <ul>
 270 <li><strong><a href=
 271 "../WeakHashMap.html">WeakHashMap</a></strong>
 272 - An implementation of the <code>Map</code> interface that stores only
 273 <a href="../../lang/ref/WeakReference.html"><i>weak
 274 references</i></a> to its keys. Storing only weak references
 275 enables key-value pairs to be garbage collected when the key is no
 276 longer referenced outside of the <code>WeakHashMap</code>. This class
 277 is the easiest way to use the power of weak references. It is
 278 useful for implementing registry-like data structures, where the
 279 utility of an entry vanishes when its key is no longer reachable by
 280 any thread.</li>
 281 <li><strong><a href=
 282 "../IdentityHashMap.html">IdentityHashMap</a></strong>
 283 - Identity-based <code>Map</code> implementation based on a hash table.
 284 This class is useful for topology-preserving object graph
 285 transformations (such as serialization or deep copying). To perform
 286 these transformations, you must maintain an identity-based "node
 287 table" that keeps track of which objects have already been seen.
 288 Identity-based maps are also used to maintain
 289 object-to-meta-information mappings in dynamic debuggers and
 290 similar systems. Finally, identity-based maps are useful in
 291 preventing "spoof attacks" resulting from intentionally perverse
 292 equals methods. (<code>IdentityHashMap</code> never invokes the equals
 293 method on its keys.) An added benefit of this implementation is
 294 that it is fast.</li>
 295 <li><strong><a href=
 296 "../concurrent/CopyOnWriteArrayList.html">CopyOnWriteArrayList</a></strong>
 297 - A <code>List</code> implementation backed by an copy-on-write array.
 298 All mutative operations (such as <code>add</code>, <code>set</code>, and
 299 <code>remove</code>) are implemented by making a new copy of the array.
 300 No synchronization is necessary, even during iteration, and
 301 iterators are guaranteed never to throw
 302 <code>ConcurrentModificationException</code>. This implementation is
 303 well-suited to maintaining event-handler lists (where change is
 304 infrequent, and traversal is frequent and potentially
 305 time-consuming).</li>
 306 <li><strong><a href=
 307 "../concurrent/CopyOnWriteArraySet.html">CopyOnWriteArraySet</a></strong>
 308 - A <code>Set</code> implementation backed by a copy-on-write array.
 309 This implementation is similar to <code>CopyOnWriteArrayList</code>.
 310 Unlike most <code>Set</code> implementations, the <code>add</code>,
 311 <code>remove</code>, and <code>contains</code> methods require time
 312 proportional to the size of the set. This implementation is well
 313 suited to maintaining event-handler lists that must prevent
 314 duplicates.</li>
 315 <li><strong><a href=
 316 "../EnumSet.html">EnumSet</a></strong> - A
 317 high-performance <code>Set</code> implementation backed by a bit
 318 vector. All elements of each <code>EnumSet</code> instance must be
 319 elements of a single enum type.</li>
 320 <li><strong><a href=
 321 "../EnumMap.html">EnumMap</a></strong> - A
 322 high-performance <code>Map</code> implementation backed by an array.
 323 All keys in each <code>EnumMap</code> instance must be elements of a
 324 single enum type.</li>
 325 </ul>
 326 </li>
 327 <li><strong>Concurrent implementations</strong> - These
 328 implementations are part of <code>java.util.concurrent</code>.
 329 <ul>
 330 <li><strong><a href=
 331 "../concurrent/ConcurrentLinkedQueue.html">ConcurrentLinkedQueue</a></strong>
 332 - An unbounded first in, first out (FIFO) queue based on linked
 333 nodes.</li>
 334 <li><a href=
 335 "../concurrent/LinkedBlockingQueue.html"><strong>
 336 LinkedBlockingQueue</strong></a> - An optionally bounded FIFO
 337 blocking queue backed by linked nodes.</li>
 338 <li><a href=
 339 "../concurrent/ArrayBlockingQueue.html"><strong>
 340 ArrayBlockingQueue</strong></a> - A bounded FIFO blocking queue
 341 backed by an array.</li>
 342 <li><a href=
 343 "../concurrent/PriorityBlockingQueue.html"><strong>
 344 PriorityBlockingQueue</strong></a> - An unbounded blocking priority
 345 queue backed by a priority heap.</li>
 346 <li><a href=
 347 "../concurrent/DelayQueue.html"><strong>DelayQueue</strong></a>
 348 - A time-based scheduling queue backed by a priority heap.</li>
 349 <li><a href=
 350 "../concurrent/SynchronousQueue.html"><strong>SynchronousQueue</strong></a>
 351 - A simple rendezvous mechanism that uses the
 352 <code>BlockingQueue</code> interface.</li>
 353 <li><a href=
 354 "../concurrent/LinkedBlockingDeque.html"><strong>
 355 LinkedBlockingDeque</strong></a> - An optionally bounded FIFO
 356 blocking deque backed by linked nodes.</li>
 357 <li><a href=
 358 "../concurrent/LinkedTransferQueue.html"><strong>
 359 LinkedTransferQueue</strong></a> - An unbounded
 360 <code>TransferQueue</code> backed by linked nodes.</li>
 361 <li><a href=
 362 "../concurrent/ConcurrentHashMap.html"><strong>ConcurrentHashMap</strong></a>
 363 - A highly concurrent, high-performance <code>ConcurrentMap</code>
 364 implementation based on a hash table. This implementation never
 365 blocks when performing retrievals and enables the client to select
 366 the concurrency level for updates. It is intended as a drop-in
 367 replacement for <code><a href=
 368 "../Hashtable.html">Hashtable</a></code>. In
 369 addition to implementing <code>ConcurrentMap</code>, it supports all of
 370 the legacy methods of <code>Hashtable</code>.</li>
 371 <li><a href=
 372 "../concurrent/ConcurrentSkipListSet.html"><strong>
 373 ConcurrentSkipListSet</strong></a> - Skips list implementation of
 374 the <code>NavigableSet</code> interface.</li>
 375 <li><a href=
 376 "../concurrent/ConcurrentSkipListMap.html"><strong>
 377 ConcurrentSkipListMap</strong></a> - Skips list implementation of
 378 the <code>ConcurrentNavigableMap</code> interface.</li>
 379 </ul>
 380 </li>
 381 <li><strong>Abstract implementations</strong> - Skeletal
 382 implementations of the collection interfaces to facilitate custom
 383 implementations.
 384 <ul>
 385 <li><a href=
 386 "../AbstractCollection.html"><strong>AbstractCollection</strong></a>
 387 - Skeletal <code>Collection</code> implementation that is neither a set
 388 nor a list (such as a "bag" or multiset).</li>
 389 <li><a href=
 390 "../AbstractSet.html"><strong>AbstractSet</strong></a>
 391 - Skeletal <code>Set</code> implementation.</li>
 392 <li><a href=
 393 "../AbstractList.html"><strong>AbstractList</strong></a>
 394 - Skeletal <code>List</code> implementation backed by a random access
 395 data store (such as an array).</li>
 396 <li><a href=
 397 "../AbstractSequentialList.html"><strong>AbstractSequentialList</strong></a>
 398 - Skeletal <code>List</code> implementation backed by a sequential
 399 access data store (such as a linked list).</li>
 400 <li><a href=
 401 "../AbstractQueue.html"><strong>AbstractQueue</strong></a>
 402 - Skeletal <code>Queue</code> implementation.</li>
 403 <li><a href=
 404 "../AbstractMap.html"><strong>AbstractMap</strong></a>
 405 - Skeletal <code>Map</code> implementation.</li>
 406 </ul>
 407 </li>
 408 <li><strong>Algorithms</strong> - The <a href=
 409 "../Collections.html"><strong>Collections</strong></a>
 410 class contains these useful static methods.
 411 <ul>
 412 <li><strong><a href=
 413 "../Collections.html#sort-java.util.List-">sort(List)</a></strong>
 414 - Sorts a list using a merge sort algorithm, which provides average
 415 case performance comparable to a high quality quicksort, guaranteed
 416 O(n*log n) performance (unlike quicksort), and <em>stability</em>
 417 (unlike quicksort). A stable sort is one that does not reorder
 418 equal elements.</li>
 419 <li><strong><a href=
 420 "../Collections.html#binarySearch-java.util.List-T-">
 421 binarySearch(List, Object)</a></strong> - Searches for an element
 422 in an ordered list using the binary search algorithm.</li>
 423 <li><strong><a href=
 424 "../Collections.html#reverse-java.util.List-">reverse(List)</a></strong>
 425 - Reverses the order of the elements in a list.</li>


 471 <li><strong><a href=
 472 "../Collections.html#disjoint-java.util.Collection-java.util.Collection-">
 473 disjoint(Collection, Collection)</a></strong> - Determines whether
 474 two collections are disjoint, in other words, whether they contain
 475 no elements in common.</li>
 476 <li><strong><a href=
 477 "../Collections.html#addAll-java.util.Collection-T...-">
 478 addAll(Collection&lt;? super T&gt;, T...)</a></strong> - Adds all
 479 of the elements in the specified array to the specified
 480 collection.</li>
 481 </ul>
 482 </li>
 483 <li><strong>Infrastructure</strong>
 484 <ul>
 485 <li><strong>Iterators</strong> - Similar to the familiar <a href=
 486 "../Enumeration.html">Enumeration</a>
 487 interface, but more powerful, and with improved method names.
 488 <ul>
 489 <li><a href=
 490 "../Iterator.html"><strong>Iterator</strong></a>
 491 - In addition to the functionality of the <code>Enumeration</code>
 492 interface, enables the user to remove elements from the backing
 493 collection with well-defined, useful semantics.</li>
 494 <li><a href=
 495 "../ListIterator.html"><strong>ListIterator</strong></a>
 496 - Iterator for use with lists. In addition to the functionality of
 497 the <code>Iterator</code> interface, supports bidirectional iteration,
 498 element replacement, element insertion, and index retrieval.</li>
 499 </ul>
 500 </li>
 501 <li><strong>Ordering</strong>
 502 <ul>
 503 <li><a href=
 504 "../../lang/Comparable.html"><strong>Comparable</strong></a>
 505 - Imparts a <i>natural ordering</i> to classes that implement it.
 506 The natural ordering can be used to sort a list or maintain order
 507 in a sorted set or map. Many classes were retrofitted to implement
 508 this interface.</li>
 509 <li><a href=
 510 "../Comparator.html"><strong>Comparator</strong></a>
 511 - Represents an order relation, which can be used to sort a list or
 512 maintain order in a sorted set or map. Can override a type's
 513 natural ordering or order objects of a type that does not implement
 514 the <code>Comparable</code> interface.</li>
 515 </ul>
 516 </li>
 517 <li><strong>Runtime exceptions</strong>
 518 <ul>
 519 <li><a href=
 520 "../../lang/UnsupportedOperationException.html"><strong>
 521 UnsupportedOperationException</strong></a> - Thrown by collections
 522 if an unsupported optional operation is called.</li>
 523 <li><a href=
 524 "../ConcurrentModificationException.html"><strong>
 525 ConcurrentModificationException</strong></a> - Thrown by iterators
 526 and list iterators if the backing collection is changed
 527 unexpectedly while the iteration is in progress. Also thrown by
 528 <i>sublist</i> views of lists if the backing list is changed
 529 unexpectedly.</li>
 530 </ul>
 531 </li>
 532 <li><strong>Performance</strong>
 533 <ul>
 534 <li><strong><a href=
 535 "../RandomAccess.html">RandomAccess</a></strong>
 536 - Marker interface that lets <code>List</code> implementations indicate
 537 that they support fast (generally constant time) random access.
 538 This lets generic algorithms change their behavior to provide good
 539 performance when applied to either random or sequential access
 540 lists.</li>
 541 </ul>
 542 </li>
 543 </ul>
 544 </li>
 545 <li><strong>Array Utilities</strong>
 546 <ul>
 547 <li><a href=
 548 "../Arrays.html"><strong>Arrays</strong></a> -
 549 Contains static methods to sort, search, compare, hash, copy,
 550 resize, convert to <code>String</code>, and fill arrays of primitives
 551 and objects.</li>
 552 </ul>
 553 </li>
 554 </ul>
 555 <hr>
 556 <p style="font-size:smaller">
 557 Copyright &copy; 1998, 2017, Oracle and/or its affiliates. 500 Oracle Parkway<br>
 558     Redwood Shores, CA 94065 USA. All rights reserved.</p>
 559 <!-- Body text ends here -->
 560 </body>
 561 </html>
< prev index next >