JavaTM 2 Platform
Standard Ed. 6

接口 java.util.SortedSet
的使用

使用 SortedSet 的软件包
java.util 包含 collection 框架、遗留的 collection 类、事件模型、日期和时间设施、国际化和各种实用工具类(字符串标记生成器、随机数生成器和位数组)。 
java.util.concurrent 在并发编程中很常用的实用工具类。 
 

java.utilSortedSet 的使用
 

java.utilSortedSet 的子接口
 interface NavigableSet<E>
          扩展的 SortedSet,具有了为给定搜索目标报告最接近匹配项的导航方法。
 

实现 SortedSetjava.util 中的类
 class TreeSet<E>
          基于 TreeMapNavigableSet 实现。
 

返回 SortedSetjava.util 中的方法
static
<E> SortedSet<E>
Collections.checkedSortedSet(SortedSet<E> s, Class<E> type)
          返回指定有序 set 的一个动态类型安全视图。
 SortedSet<E> TreeSet.headSet(E toElement)
           
 SortedSet<E> NavigableSet.headSet(E toElement)
          返回此 set 的部分视图,其元素严格小于 toElement
 SortedSet<E> SortedSet.headSet(E toElement)
          返回此 set 的部分视图,其元素严格小于 toElement
 SortedSet<E> TreeSet.subSet(E fromElement, E toElement)
           
 SortedSet<E> NavigableSet.subSet(E fromElement, E toElement)
          返回此 set 的部分视图,其元素从 fromElement(包括)到 toElement(不包括)。
 SortedSet<E> SortedSet.subSet(E fromElement, E toElement)
          返回此 set 的部分视图,其元素从 fromElement(包括)到 toElement(不包括)。
static
<T> SortedSet<T>
Collections.synchronizedSortedSet(SortedSet<T> s)
          返回指定有序 set 支持的同步(线程安全的)有序 set。
 SortedSet<E> TreeSet.tailSet(E fromElement)
           
 SortedSet<E> NavigableSet.tailSet(E fromElement)
          返回此 set 的部分视图,其元素大于等于 fromElement
 SortedSet<E> SortedSet.tailSet(E fromElement)
          返回此 set 的部分视图,其元素大于等于 fromElement
static
<T> SortedSet<T>
Collections.unmodifiableSortedSet(SortedSet<T> s)
          返回指定有序 set 的不可修改视图。
 

参数类型为 SortedSetjava.util 中的方法
static
<E> SortedSet<E>
Collections.checkedSortedSet(SortedSet<E> s, Class<E> type)
          返回指定有序 set 的一个动态类型安全视图。
static
<T> SortedSet<T>
Collections.synchronizedSortedSet(SortedSet<T> s)
          返回指定有序 set 支持的同步(线程安全的)有序 set。
static
<T> SortedSet<T>
Collections.unmodifiableSortedSet(SortedSet<T> s)
          返回指定有序 set 的不可修改视图。
 

参数类型为 SortedSetjava.util 中的构造方法
PriorityQueue(SortedSet<? extends E> c)
          创建包含指定有序 set 元素的 PriorityQueue
TreeSet(SortedSet<E> s)
          构造一个与指定有序 set 具有相同映射关系和相同排序的新 TreeSet。
 

java.util.concurrentSortedSet 的使用
 

实现 SortedSetjava.util.concurrent 中的类
 class ConcurrentSkipListSet<E>
          一个基于 ConcurrentSkipListMap 的可缩放并发 NavigableSet 实现。
 

参数类型为 SortedSetjava.util.concurrent 中的构造方法
ConcurrentSkipListSet(SortedSet<E> s)
          构造一个新 set,该 set 所包含的元素与指定的有序 set 包含的元素相同,使用的顺序也相同。
 


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only