2.2学习内容

list、map一下方法:

http://blog.csdn.net/u012152619/article/details/42674413


方法列表

static <T>boolean addAll(Collection<? superT> c, T... elements)

          将所有指定元素添加到指定collection 中。

static <T>int binarySearch(List<? extendsComparable<? super T>> list, T key)

          使用二分搜索法搜索指定列表,以获得指定对象。

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

          返回指定 collection 的一个动态类型安全视图。

static <E>List<E> checkedList(List<E>list, Class<E> type)

          返回指定列表的一个动态类型安全视图。

static<K,V> Map<K,V> checkedMap(Map<K,V>m, Class<K> keyType, Class<V> valueType)

          返回指定映射的一个动态类型安全视图。

static <E>Set<E> checkedSet(Set<E>s, Class<E> type)

          返回指定 set 的一个动态类型安全视图。

static<K,V> SortedMap<K,V> checkedSortedMap(SortedMap<K,V>m, Class<K> keyType, Class<V> valueType)

          返回指定有序映射的一个动态类型安全视图。

static <E>SortedSet<E> checkedSortedSet(SortedSet<E>s, Class<E> type)

          返回指定有序 set 的一个动态类型安全视图。

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

          将所有元素从一个列表复制到另一个列表。

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

          如果两个指定 collection 中没有相同的元素,则返回true。

static <T>List<T> emptyList()

          返回空的列表(不可变的)。

static<K,V> Map<K,V> emptyMap()

          返回空的映射(不可变的)。

static <T>Set<T> emptySet()

          返回空的 set(不可变的)。

static <T>Enumeration<T> enumeration(Collection<T>c)

          返回一个指定 collection 上的枚举。

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

          使用指定元素替换指定列表中的所有元素。

static int frequency(Collection<?> c, Objecto)

          返回指定 collection 中等于指定对象的元素数。

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

          返回指定源列表中第一次出现指定目标列表的起始位置;如果没有出现这样的列表,则返回 -1。

static int lastIndexOfSubList(List<?>source, List<?> target)

          返回指定源列表中最后一次出现指定目标列表的起始位置;如果没有出现这样的列表,则返回 -1。

static <T>ArrayList<T> list(Enumeration<T>e)

          返回一个数组列表,它按返回顺序包含指定枚举返回的元素。

static <Textends Object & Comparable<? super T>> T max(Collection<?extends T> coll)

          根据元素的自然顺序,返回给定collection 的最大元素。

static <Textends Object & Comparable<? super T>> Tmin(Collection<? extends T> coll)

          根据元素的自然顺序 返回给定 collection 的最小元素。

static <T>List<T>  nCopies(int n, T o)

          返回由指定对象的 n 个副本组成的不可变列表。

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

          使用另一个值替换列表中出现的所有某一指定值。

static void reverse(List<?> list)

          反转指定列表中元素的顺序。 

static void rotate(List<?> list, int distance)

          根据指定的距离轮换指定列表中的元素。

static void shuffle(List<?> list)

          使用默认随机源对指定列表进行置换。 

static <T>Set<T> singleton(T o)

          返回一个只包含指定对象的不可变 set。

static <T>List<T> singletonList(T o)

          返回一个只包含指定对象的不可变列表。

static<K,V> Map<K,V> singletonMap(Kkey, V value)

          返回一个不可变的映射,它只将指定键映射到指定值。

static <Textends Comparable<? super T>> voidsort(List<T> list)

          根据元素的自然顺序 对指定列表按升序进行排序。

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

          在指定列表的指定位置处交换元素。

static <T>Collection<T> synchronizedCollection(Collection<T>c)

          返回指定 collection 支持的同步(线程安全的)collection。

static <T>List<T> synchronizedList(List<T>list)

          返回指定列表支持的同步(线程安全的)列表。

static<K,V> Map<K,V> synchronizedMap(Map<K,V>m)

          返回由指定映射支持的同步(线程安全的)映射。

static <T>Set<T> synchronizedSet(Set<T>s)

          返回指定 set 支持的同步(线程安全的)set。

static<K,V> SortedMap<K,V> synchronizedSortedMap(SortedMap<K,V>m)

          返回指定有序映射支持的同步(线程安全的)有序映射。

static <T>SortedSet<T> synchronizedSortedSet(SortedSet<T>s)

          返回指定有序 set 支持的同步(线程安全的)有序 set。

static <T>Collection<T> unmodifiableCollection(Collection<?extends T> c)

          返回指定 collection 的不可修改视图。

static <T>List<T> unmodifiableList(List<?extends T> list)

          返回指定列表的不可修改视图。

static<K,V> Map<K,V> unmodifiableMap(Map<?extends K,? extends V> m)

          返回指定映射的不可修改视图。

static <T>Set<T> unmodifiableSet(Set<?extends T> s)

          返回指定 set 的不可修改视图。

static<K,V> SortedMap<K,V> unmodifiableSortedMap(SortedMap<K,?extends V> m)

          返回指定有序映射的不可修改视图。

static <T>SortedSet<T> unmodifiableSortedSet(SortedSet<T>s)

          返回指定有序 set 的不可修改视图。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值