Java collections sort method

broken image
broken image

Sorts the specified list into ascending order, according to theĪll elements in the list must implement the Comparable ForĮxample, invoking the sort method on an unmodifiable list that isĪlready sorted may or may not throw UnsupportedOperationException. These algorithms may, but are not required to, throw thisĮxception if an invocation would have no effect on the collection. Support the appropriate mutation primitive(s), such as the set To throw UnsupportedOperationException if the collection does not The 'destructive' algorithms contained in this class, that is, theĪlgorithms that modify the collection on which they operate, are specified

broken image

(For example, the algorithm used by sort does not have to beĪ mergesort, but it does have to be stable.) Substitute other algorithms, so long as the specification itself is adhered Suchĭescriptions should be regarded as implementation notes, rather than Generally includes a brief description of the implementation. The documentation for the polymorphic algorithms contained in this class If the collections or class objects provided to them are null. The methods of this class all throw a NullPointerException Specified collection, and a few other odds and ends.

broken image

It contains polymorphic algorithms that operate onĬollections, 'wrappers', which return a new collection backed by a This class consists exclusively of static methods that operate on or returnĬollections.

broken image