| 函数名|描述 |
| --- | --- |
| 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)||
- 参考资料
- 容器的实现
- ArrayList、LinkedList与Vector的区别
- Map,Set,List,Queue,Stack的特点与用法
- HashMap的实现
- HashMap和ConcurrentHashMap差别
- HashMap和HashTable的区别
- fast fail
- java 实用方法
- Collections中实用的函数
- ArrayList中实用的函数
- Integer和Character
- Properties类的简单使用
- XML实用解析
- 从jar包中读取文件信息
- java自带base64加密解密
- java机制
- 分派
- 反射
- 类加载机制
- java中一个对象的初始化
- 泛型
- 自动装箱,拆箱与遍历循环
- 偏向于语法
- new int[]
- new boolean[]
- Switch能否用string做参数
- equals与==的区别
- 泛型对象数组
- Enum的用法
- String、StringBuffer与StringBuilder的区别
- try catch finally
- finalize方法
- object有哪些公用方法
- Java的四种引用,强弱软虚,用到的场景
- java访问修饰符
- Hashcode的作用
- 九种基本数据类型
- java对象大小
- 数组长度
- 动态代理的一个例子
- java.lang.NoClassDefFoundError
- ThreadLocal