多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
| 函数名|描述 | | --- | --- | | public static <T extends Comparable<? super T>> void sort(List<T> list) | Sorts the specified list into ascending order, according to the { Comparable natural ordering} of its elements.All elements in the list must implement the {Comparable} interface. <br>Furthermore, all elements in the list must be <i>mutually comparable</i> (that is, { e1.compareTo(e2)} must not throw a { ClassCastException} for any elements `e1` and `e2` in the list). | |public static <T> void sort(List<T> list, Comparator<? super T> c)|Sorts the specified list according to the order induced by the specified comparator. All elements in the list must be <i>mutually comparable</i> using the specified comparator (that is, {c.compare(e1, e2)} must not throw a {ClassCastException} for any elements {@code e1} and {@code e2} in the list).| |public static void reverse(List<?> list)|Reverses the order of the elements in the specified list.| |public static void swap(List<?> list, int i, int j)|Swaps the elements at the specified positions in the specified list.<br>(If the specified positions are equal, invoking this method leaves the list unchanged.)| |private static void swap(Object[] arr, int i, int j)|Swaps the two specified elements in the specified array.| |public static <T extends Object & Comparable<? super T>> T min(Collection<? extends T> coll)|Returns the minimum element of the given collection, according to the <i>natural ordering</i> of its elements. All elements in the collection must implement the <tt>Comparable</tt> interface.<br>Furthermore, all elements in the collection must be <i>mutually omparable</i> (that is, <tt>e1.compareTo(e2)</tt> must not throw a <tt>ClassCastException</tt> for any elements <tt>e1</tt> and <tt>e2</tt> in the collection).<p>| |public static <T> T min(Collection<? extends T> coll, Comparator<? super T> comp)|Returns the minimum element of the given collection, according to the order induced by the specified comparator. <br>All elements in the collection must be <i>mutually comparable</i> by the specified comparator (that is, <tt>comp.compare(e1, e2)</tt> must not throw a <tt>ClassCastException</tt> for any elements <tt>e1</tt> and <tt>e2</tt> in the collection).<p>| |public static <T extends Object & Comparable<? super T>> T max(Collection<? extends T> coll)|类似| |public static <T> T max(Collection<? extends T> coll, Comparator<? super T> comp)|类似| |public static void rotate(List<?> list, int distance)||