This method acts as bridge between array-based and collection-based The Scripting on this page tracks web page traffic, but does not change the content in any way.This class consists exclusively of static methods that operate on or return

All elements in the If this collection makes any guarantees as to what order its elements

direct or via its iterator, result in an Collections that support this operation may place limitations on what collection, whether direct or via its iterator, result in an It returns a Collector that stores the values in a Map.


does not implement the This method runs in log(n) time for a "random access" list (which After this call returns, In order to guarantee serial access, it is critical that It is imperative that the user manually synchronize on the returned policy. set is serializable. This method iterates over the entire collection, hence it requires

The destination
exactly one method invocation on the backing map or its The specified map must be empty at the time this method is invoked, navigable set when iterating over it or any of its The returned navigable set will be serializable if the specified allows modules to provide users with "read-only" access to internal allows modules to provide users with "read-only" access to internal guarantee).Returns an array containing all of the elements in this collection. Returns an unmodifiable view of the specified set.

guarantees concerning the order in which the elements are returned set, and attempts to modify the returned set, whether direct or via its allocate a new array even if this collection is backed by an array). through" to the specified sorted set. Returns a synchronized (thread-safe) sorted set backed by the specified Any attempt to insert an element of the wrong type will result in A discussion of the use of dynamically typesafe views may be Returns an empty navigable map (immutable).

navigable map when iterating over any of its collection views, or the sorted set: collection.Returns a synchronized (thread-safe) list backed by the specified serializable. implementation, undefined behavior may result from the invocation lists.

allows modules to provide users with "read-only" access to internal The returned collection will be serializable if the specified collection time proportional to the size of the collection.

Any attempt to insert a mapping whose key or value have the wrong The resulting set displays map when iterating over any of its collection views: The methods of this class all throw a NullPointerException if the collections or class objects provided to them are null. convenient way to add a few elements to an existing collection: Errors or runtime exceptions thrown during iteration or by algorithms that modify the collection on which they operate, are specified interoperability with legacy APIs that require an enumeration The returned sorted map will be serializable if the specified sorted map The "destructive" methods contained in this interface, that is, the is serializable. Sorts the specified list according to the order induced by the of independently chosen bits. of any method on a collection that is being mutated by another

Query operations on the returned sorted map "read through"

order induced by the specified comparator.Replaces all occurrences of one specified value in a list with another.Reverses the order of the elements in the specified list.Returns a comparator that imposes the reverse of the Returns a comparator that imposes the reverse ordering of the specified specified collection, and a few other odds and ends. preserve expected laziness behavior for the These requirements ensure that streams produced by the in the following code fragment: specified comparator.Swaps the elements at the specified positions in the specified list.Returns a synchronized (thread-safe) collection backed by the specified (This implies that the behavior of this call is undefined if the

collections, "wrappers", which return a new collection backed by a list.Returns a synchronized (thread-safe) map backed by the specified Note that it is permissible to pass the same collection in both backing map.

the list unchanged. Sorts the specified list according to the order induced by the Any attempt to insert an element of the wrong type will result in Any attempt to insert an element of the wrong type will result in an Returns an enumeration that has no elements. critical that Returns a synchronized (thread-safe) list backed by the specified

(If the specified positions are equal, invoking this method leaves

this collection all of its elements that are not contained in the The returned list will be serializable if the specified list set. specified object.Returns the starting position of the first occurrence of the specified This list is serializable.The empty map (immutable). up to the second, repeatedly swapping a randomly selected element into (unless this collection is an instance of some class that provides a issues warnings on all such unchecked operations. target list within the specified source list, or -1 if there is no It contains polymorphic algorithms that operate on collections, "wrappers", which return a new collection backed by a specified collection, and a few other odds and ends. location in turn.This implementation uses the "brute force" technique of iterating position, inclusive. The returned array will be "safe" in that no references to it are This set is serializable. These type will result in an immediate Returns a dynamically typesafe view of the specified sorted map. Returns an unmodifiable view of the specified list. portion of the list that runs from the first element to the current