SortedSet接口源码解析
来源:互联网 发布:域名证书是什么作用 编辑:程序博客网 时间:2024/05/19 06:36
SortedSet接口为TreeSet做准备
可以实现排序集合
源码
package java.util;public interface SortedSet<E> extends Set<E> { /** * 比较器 */ Comparator<? super E> comparator(); /** * 获取子集 * @throws ClassCastException if <tt>fromElement</tt> and * <tt>toElement</tt> cannot be compared to one another using this * set's comparator (or, if the set has no comparator, using * natural ordering). Implementations may, but are not required * to, throw this exception if <tt>fromElement</tt> or * <tt>toElement</tt> cannot be compared to elements currently in * the set. * @throws NullPointerException if <tt>fromElement</tt> or * <tt>toElement</tt> is null and this set does not permit null * elements * @throws IllegalArgumentException if <tt>fromElement</tt> is * greater than <tt>toElement</tt>; or if this set itself * has a restricted range, and <tt>fromElement</tt> or * <tt>toElement</tt> lies outside the bounds of the range */ SortedSet<E> subSet(E fromElement, E toElement); /** * 获取严格小于toElement的子集 * * @param toElement high endpoint (exclusive) of the returned set * @return a view of the portion of this set whose elements are strictly * less than <tt>toElement</tt> * @throws ClassCastException if <tt>toElement</tt> is not compatible * with this set's comparator (or, if the set has no comparator, * if <tt>toElement</tt> does not implement {@link Comparable}). * Implementations may, but are not required to, throw this * exception if <tt>toElement</tt> cannot be compared to elements * currently in the set. * @throws NullPointerException if <tt>toElement</tt> is null and * this set does not permit null elements * @throws IllegalArgumentException if this set itself has a * restricted range, and <tt>toElement</tt> lies outside the * bounds of the range */ SortedSet<E> headSet(E toElement); /** * 获取大于等于fromElement的子集 * * @param fromElement low endpoint (inclusive) of the returned set * @return a view of the portion of this set whose elements are greater * than or equal to <tt>fromElement</tt> * @throws ClassCastException if <tt>fromElement</tt> is not compatible * with this set's comparator (or, if the set has no comparator, * if <tt>fromElement</tt> does not implement {@link Comparable}). * Implementations may, but are not required to, throw this * exception if <tt>fromElement</tt> cannot be compared to elements * currently in the set. * @throws NullPointerException if <tt>fromElement</tt> is null * and this set does not permit null elements * @throws IllegalArgumentException if this set itself has a * restricted range, and <tt>fromElement</tt> lies outside the * bounds of the range */ SortedSet<E> tailSet(E fromElement); /** * 第一个元素 * * @return the first (lowest) element currently in this set * @throws NoSuchElementException if this set is empty */ E first(); /** * 最后一个元素 * * @return the last (highest) element currently in this set * @throws NoSuchElementException if this set is empty */ E last();}
0 0
- SortedSet接口源码解析
- SortedSet接口
- SortedSet接口
- SortedSet接口
- JAVA类集----SortedSet接口
- java SortedSet接口
- Java类集-SortedSet接口
- SortedSet 接口 源代码
- java类集---SortedSet接口
- .NET源码中的SortedSet
- java SortedSet接口swap方法
- Collection接口源码解析
- List接口源码解析
- Queue接口源码解析
- Deque接口源码解析
- Set接口源码解析
- Map接口源码解析
- SortedMap接口源码解析
- 微服务架构下的数据一致性:可靠事件模式
- UITableView的使用样例(简易向)
- linux的用户管理及磁盘挂载
- 单调队列1004 Codeforces Round #154 (Div. 2) 253D. Table with Letters - 2
- svg教程集合
- SortedSet接口源码解析
- java中常见疑惑点解密
- 网页当前时间显示(特效)
- Guess Number Higher or Lower II
- 单调队列 1005 HDU 2430 Beans
- Linux+C(一)
- 获取输入法候选调研
- spark 评估指标
- Educational Codeforces Round 14 题解