50 |
* <code>k1.compareTo(k2)</code> or <code>comparator.compare(k1, k2)</code> |
* <code>k1.compareTo(k2)</code> or <code>comparator.compare(k1, k2)</code> |
51 |
* must not throw a ClassCastException. The ordering must be <i>consistent |
* must not throw a ClassCastException. The ordering must be <i>consistent |
52 |
* with equals</i> (see {@link Comparator} for this definition), if the |
* with equals</i> (see {@link Comparator} for this definition), if the |
53 |
* map is to obey the general contract of the Set interface. If not, |
* set is to obey the general contract of the Set interface. If not, |
54 |
* the results are well-defined, but probably not what you wanted. |
* the results are well-defined, but probably not what you wanted. |
55 |
* <p> |
* <p> |
56 |
* |
* |
85 |
Comparator<? super E> comparator(); |
Comparator<? super E> comparator(); |
86 |
|
|
87 |
/** |
/** |
88 |
* Returns the first (lowest sorted) element in the map. |
* Returns the first (lowest sorted) element in the set. |
89 |
* |
* |
90 |
* @return the first element |
* @return the first element |
91 |
* @throws NoSuchElementException if the set is empty. |
* @throws NoSuchElementException if the set is empty. |
110 |
* contents |
* contents |
111 |
* @throws IllegalArgumentException if this is a subSet, and toElement is out |
* @throws IllegalArgumentException if this is a subSet, and toElement is out |
112 |
* of range |
* of range |
113 |
* @throws NullPointerException if toElement is null but the map does not |
* @throws NullPointerException if toElement is null but the set does not |
114 |
* allow null elements |
* allow null elements |
115 |
*/ |
*/ |
116 |
SortedSet<E> headSet(E toElement); |
SortedSet<E> headSet(E toElement); |
117 |
|
|
118 |
/** |
/** |
119 |
* Returns the last (highest sorted) element in the map. |
* Returns the last (highest sorted) element in the set. |
120 |
* |
* |
121 |
* @return the last element |
* @return the last element |
122 |
* @throws NoSuchElementException if the set is empty. |
* @throws NoSuchElementException if the set is empty. |