java的collections工具类

来源:互联网 发布:网络教育学籍档案 编辑:程序博客网 时间:2024/05/22 06:46

常用方法,多用才熟练:


addAll(Collection<? super T> c, T... elements)

binarySearch(List<? extends T> list, T key,Comparator<? super T> c)

checkedCollection(Collection<E> c,Class<E> type)

copy(List<? super T> dest,List<? extends T> src)

disjoint(Collection<?> c1,Collection<?> c2)

enumeration(Collection<T> c)

fill(List<? super T> list, T obj)

frequency(Collection<?> c,Object o)

indexOfSubList(List<?> source,List<?> target)

list(Enumeration<T> e)

max(Collection<? extends T> coll,Comparator<? super T> comp)

min(Collection<? extends T> coll,Comparator<? super T> comp)

replaceAll(List<T> list, T oldVal, T newVal)

reverse(List<?> list)

rotate(List<?> list, int distance)

sort(List<T> list,Comparator<? super T> c)

swap(List<?> list, int i, int j)


0 0