5 |
|
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. |
6 |
|
*/ |
7 |
|
|
8 |
< |
package java.util; |
8 |
> |
package java.util; |
9 |
|
|
10 |
|
/** |
11 |
|
* This class implements the <tt>Set</tt> interface, backed by a |
265 |
|
if (m.size()==0 && c.size() > 0 && |
266 |
|
c instanceof SortedSet && |
267 |
|
m instanceof TreeMap) { |
268 |
< |
SortedSet<Map.Entry<E, Object>> set = (SortedSet<Map.Entry<E, Object>>) (SortedSet) c; |
268 |
> |
SortedSet<? extends E> set = (SortedSet<? extends E>) c; |
269 |
|
TreeMap<E,Object> map = (TreeMap<E, Object>) m; |
270 |
< |
Comparator<? super E> cc = (Comparator<E>) set.comparator(); |
270 |
> |
Comparator<? super E> cc = (Comparator<? super E>) set.comparator(); |
271 |
|
Comparator<? super E> mc = map.comparator(); |
272 |
|
if (cc==mc || (cc != null && cc.equals(mc))) { |
273 |
|
map.addAllForTreeSet(set, PRESENT); |
299 |
|
* For example, suppose that <tt>s</tt> is a navigable set of |
300 |
|
* strings. The following idiom obtains a view containing all of |
301 |
|
* the strings in <tt>s</tt> from <tt>low</tt> to <tt>high</tt>, |
302 |
< |
* inclusive: |
302 |
> |
* inclusive: |
303 |
|
* <pre> NavigableSet sub = s.navigableSubSet(low, high+"\0"); |
304 |
|
* </pre> |
305 |
|
* |
349 |
|
* bounded by <tt>successor(highEndpoint)</tt>. For example, |
350 |
|
* suppose that <tt>s</tt> is a navigable set of strings. The |
351 |
|
* following idiom obtains a view containing all of the strings in |
352 |
< |
* <tt>s</tt> that are less than or equal to <tt>high</tt>: |
352 |
> |
* <tt>s</tt> that are less than or equal to <tt>high</tt>: |
353 |
|
* <pre> NavigableSet head = s.navigableHeadSet(high+"\0");</pre> |
354 |
|
* |
355 |
|
* @param toElement high endpoint (exclusive) of the headSet. |
510 |
|
/** |
511 |
|
* Returns an element greater than or equal to the given element, or |
512 |
|
* <tt>null</tt> if there is no such element. |
513 |
< |
* |
513 |
> |
* |
514 |
|
* @param e the value to match |
515 |
|
* @return an element greater than or equal to given element, or |
516 |
|
* <tt>null</tt> if there is no such element. |
527 |
|
/** |
528 |
|
* Returns an element strictly less than the given element, or |
529 |
|
* <tt>null</tt> if there is no such element. |
530 |
< |
* |
530 |
> |
* |
531 |
|
* @param e the value to match |
532 |
|
* @return the greatest element less than the given element, or |
533 |
|
* <tt>null</tt> if there is no such element. |
544 |
|
/** |
545 |
|
* Returns an element less than or equal to the given element, or |
546 |
|
* <tt>null</tt> if there is no such element. |
547 |
< |
* |
547 |
> |
* |
548 |
|
* @param e the value to match |
549 |
|
* @return the greatest element less than or equal to given |
550 |
|
* element, or <tt>null</tt> if there is no such element. |
561 |
|
/** |
562 |
|
* Returns an element strictly greater than the given element, or |
563 |
|
* <tt>null</tt> if there is no such element. |
564 |
< |
* |
564 |
> |
* |
565 |
|
* @param e the value to match |
566 |
|
* @return the least element greater than the given element, or |
567 |
|
* <tt>null</tt> if there is no such element. |
652 |
|
s.defaultReadObject(); |
653 |
|
|
654 |
|
// Read in Comparator |
655 |
< |
Comparator<E> c = (Comparator<E>) s.readObject(); |
655 |
> |
Comparator<? super E> c = (Comparator<? super E>) s.readObject(); |
656 |
|
|
657 |
|
// Create backing TreeMap |
658 |
|
TreeMap<E,Object> tm; |