36 |
|
* <em>optional</em> methods of the {@link Set} and {@link Iterator} |
37 |
|
* interfaces. Like most other concurrent collection implementations, |
38 |
|
* this class does not permit the use of <tt>null</tt> elements. |
39 |
< |
* because null arguments and return values cannot be reliably |
39 |
> |
* because <tt>null</tt> arguments and return values cannot be reliably |
40 |
|
* distinguished from the absence of elements. |
41 |
|
* |
42 |
|
* @author Doug Lea |
85 |
|
* |
86 |
|
* @throws ClassCastException if the elements in the specified |
87 |
|
* collection are not comparable, or are not mutually comparable. |
88 |
< |
* @throws NullPointerException if the specified collection is null. |
88 |
> |
* @throws NullPointerException if the specified collection is <tt>null</tt>. |
89 |
|
*/ |
90 |
|
public ConcurrentSkipListSet(Collection<? extends E> c) { |
91 |
|
m = new ConcurrentSkipListMap<E,Object>(); |
97 |
|
* sorted set, sorted according to the same ordering. |
98 |
|
* |
99 |
|
* @param s sorted set whose elements will comprise the new set. |
100 |
< |
* @throws NullPointerException if the specified sorted set is null. |
100 |
> |
* @throws NullPointerException if the specified sorted set is <tt>null</tt>. |
101 |
|
*/ |
102 |
|
public ConcurrentSkipListSet(SortedSet<E> s) { |
103 |
|
m = new ConcurrentSkipListMap<E,Object>(s.comparator()); |
217 |
|
|
218 |
|
/** |
219 |
|
* Returns an element greater than or equal to the given element, or |
220 |
< |
* null if there is no such element. |
220 |
> |
* <tt>null</tt> if there is no such element. |
221 |
|
* |
222 |
|
* @param o the value to match |
223 |
< |
* @return an element greater than or equal to given element, or null |
223 |
> |
* @return an element greater than or equal to given element, or <tt>null</tt> |
224 |
|
* if there is no such element. |
225 |
|
* @throws ClassCastException if o cannot be compared with the elements |
226 |
|
* currently in the set. |
231 |
|
} |
232 |
|
|
233 |
|
/** |
234 |
< |
* Returns an element strictly less than the given element, or null if |
234 |
> |
* Returns an element strictly less than the given element, or <tt>null</tt> if |
235 |
|
* there is no such element. |
236 |
|
* |
237 |
|
* @param o the value to match |
238 |
|
* @return the greatest element less than the given element, or |
239 |
< |
* null if there is no such element. |
239 |
> |
* <tt>null</tt> if there is no such element. |
240 |
|
* @throws ClassCastException if o cannot be compared with the elements |
241 |
|
* currently in the set. |
242 |
|
* @throws NullPointerException if o is <tt>null</tt>. |
246 |
|
} |
247 |
|
|
248 |
|
/** |
249 |
< |
* Returns an element less than or equal to the given element, or null |
249 |
> |
* Returns an element less than or equal to the given element, or <tt>null</tt> |
250 |
|
* if there is no such element. |
251 |
|
* |
252 |
|
* @param o the value to match |
253 |
|
* @return the greatest element less than or equal to given |
254 |
< |
* element, or null if there is no such element. |
254 |
> |
* element, or <tt>null</tt> if there is no such element. |
255 |
|
* @throws ClassCastException if o cannot be compared with the elements |
256 |
|
* currently in the set. |
257 |
|
* @throws NullPointerException if o is <tt>null</tt>. |
261 |
|
} |
262 |
|
|
263 |
|
/** |
264 |
< |
* Returns an element strictly greater than the given element, or null |
264 |
> |
* Returns an element strictly greater than the given element, or <tt>null</tt> |
265 |
|
* if there is no such element. |
266 |
|
* |
267 |
|
* @param o the value to match |
268 |
|
* @return the least element greater than the given element, or |
269 |
< |
* null if there is no such element. |
269 |
> |
* <tt>null</tt> if there is no such element. |
270 |
|
* @throws ClassCastException if o cannot be compared with the elements |
271 |
|
* currently in the set. |
272 |
|
* @throws NullPointerException if o is <tt>null</tt>. |
411 |
|
|
412 |
|
/** |
413 |
|
* Creates a new submap. |
414 |
< |
* @param fromElement inclusive least value, or null if from start |
415 |
< |
* @param toElement exclusive upper bound or null if to end |
414 |
> |
* @param fromElement inclusive least value, or <tt>null</tt> if from start |
415 |
> |
* @param toElement exclusive upper bound or <tt>null</tt> if to end |
416 |
|
* @throws IllegalArgumentException if fromElement and toElement |
417 |
|
* nonnull and fromElement greater than toElement |
418 |
|
*/ |
520 |
|
|
521 |
|
/** |
522 |
|
* Returns an element greater than or equal to the given |
523 |
< |
* element, or null if there is no such element. |
523 |
> |
* element, or <tt>null</tt> if there is no such element. |
524 |
|
* |
525 |
|
* @param o the value to match |
526 |
< |
* @return an element greater than or equal to given element, or null |
526 |
> |
* @return an element greater than or equal to given element, or <tt>null</tt> |
527 |
|
* if there is no such element. |
528 |
|
* @throws ClassCastException if o cannot be compared with the |
529 |
|
* elements currently in the set. |
539 |
|
} |
540 |
|
|
541 |
|
/** |
542 |
< |
* Returns an element strictly less than the given element, or null if |
542 |
> |
* Returns an element strictly less than the given element, or <tt>null</tt> if |
543 |
|
* there is no such element. |
544 |
|
* |
545 |
|
* @param o the value to match |
546 |
|
* @return the greatest element less than the given element, or |
547 |
< |
* null if there is no such element. |
547 |
> |
* <tt>null</tt> if there is no such element. |
548 |
|
* @throws ClassCastException if o cannot be compared with the |
549 |
|
* elements currently in the set. |
550 |
|
* @throws NullPointerException if o is <tt>null</tt>. |
555 |
|
} |
556 |
|
|
557 |
|
/** |
558 |
< |
* Returns an element less than or equal to the given element, or null |
558 |
> |
* Returns an element less than or equal to the given element, or <tt>null</tt> |
559 |
|
* if there is no such element. |
560 |
|
* |
561 |
|
* @param o the value to match |
562 |
|
* @return the greatest element less than or equal to given |
563 |
< |
* element, or null if there is no such element. |
563 |
> |
* element, or <tt>null</tt> if there is no such element. |
564 |
|
* @throws ClassCastException if o cannot be compared with the |
565 |
|
* elements currently in the set. |
566 |
|
* @throws NullPointerException if o is <tt>null</tt>. |
571 |
|
} |
572 |
|
|
573 |
|
/** |
574 |
< |
* Returns an element strictly greater than the given element, or null |
574 |
> |
* Returns an element strictly greater than the given element, or <tt>null</tt> |
575 |
|
* if there is no such element. |
576 |
|
* |
577 |
|
* @param o the value to match |
578 |
|
* @return the least element greater than the given element, or |
579 |
< |
* null if there is no such element. |
579 |
> |
* <tt>null</tt> if there is no such element. |
580 |
|
* @throws ClassCastException if o cannot be compared with the |
581 |
|
* elements currently in the set. |
582 |
|
* @throws NullPointerException if o is <tt>null</tt>. |