569 |
|
Iterator<? extends T> i = coll.iterator(); |
570 |
|
T candidate = i.next(); |
571 |
|
|
572 |
< |
while(i.hasNext()) { |
572 |
> |
while (i.hasNext()) { |
573 |
|
T next = i.next(); |
574 |
|
if (next.compareTo(candidate) < 0) |
575 |
|
candidate = next; |
606 |
|
Iterator<? extends T> i = coll.iterator(); |
607 |
|
T candidate = i.next(); |
608 |
|
|
609 |
< |
while(i.hasNext()) { |
609 |
> |
while (i.hasNext()) { |
610 |
|
T next = i.next(); |
611 |
|
if (comp.compare(next, candidate) < 0) |
612 |
|
candidate = next; |
639 |
|
Iterator<? extends T> i = coll.iterator(); |
640 |
|
T candidate = i.next(); |
641 |
|
|
642 |
< |
while(i.hasNext()) { |
642 |
> |
while (i.hasNext()) { |
643 |
|
T next = i.next(); |
644 |
|
if (next.compareTo(candidate) > 0) |
645 |
|
candidate = next; |
676 |
|
Iterator<? extends T> i = coll.iterator(); |
677 |
|
T candidate = i.next(); |
678 |
|
|
679 |
< |
while(i.hasNext()) { |
679 |
> |
while (i.hasNext()) { |
680 |
|
T next = i.next(); |
681 |
|
if (comp.compare(next, candidate) > 0) |
682 |
|
candidate = next; |
1051 |
|
* @param s the set for which an unmodifiable view is to be returned. |
1052 |
|
* @return an unmodifiable view of the specified set. |
1053 |
|
*/ |
1054 |
– |
|
1054 |
|
public static <T> Set<T> unmodifiableSet(Set<? extends T> s) { |
1055 |
|
return new UnmodifiableSet<T>(s); |
1056 |
|
} |
2245 |
|
* Dump coll into an array of the required type. This serves |
2246 |
|
* three purposes: it insulates us from concurrent changes in |
2247 |
|
* the contents of coll, it type-checks all of the elements in |
2248 |
< |
* coll, and it provides all-or-nothing semantics(which we |
2248 |
> |
* coll, and it provides all-or-nothing semantics (which we |
2249 |
|
* wouldn't get if we type-checked each element as we added it). |
2250 |
|
*/ |
2251 |
|
E[] a = null; |
2252 |
|
try { |
2253 |
|
a = coll.toArray(zeroLengthElementArray()); |
2254 |
< |
} catch(ArrayStoreException e) { |
2254 |
> |
} catch (ArrayStoreException e) { |
2255 |
|
throw new ClassCastException(); |
2256 |
|
} |
2257 |
|
|
2435 |
|
E[] a = null; |
2436 |
|
try { |
2437 |
|
a = c.toArray(zeroLengthElementArray()); |
2438 |
< |
} catch(ArrayStoreException e) { |
2438 |
> |
} catch (ArrayStoreException e) { |
2439 |
|
throw new ClassCastException(); |
2440 |
|
} |
2441 |
|
|
2581 |
|
K[] keys = null; |
2582 |
|
try { |
2583 |
|
keys = t.keySet().toArray(zeroLengthKeyArray()); |
2584 |
< |
} catch(ArrayStoreException e) { |
2584 |
> |
} catch (ArrayStoreException e) { |
2585 |
|
throw new ClassCastException(); |
2586 |
|
} |
2587 |
|
V[] values = null; |
2588 |
|
try { |
2589 |
|
values = t.values().toArray(zeroLengthValueArray()); |
2590 |
< |
} catch(ArrayStoreException e) { |
2590 |
> |
} catch (ArrayStoreException e) { |
2591 |
|
throw new ClassCastException(); |
2592 |
|
} |
2593 |
|
|
3461 |
|
* @throws UnsupportedOperationException if <tt>c</tt> does not support |
3462 |
|
* the <tt>add</tt> operation. |
3463 |
|
* @throws NullPointerException if <tt>elements</tt> contains one or more |
3464 |
< |
* null values and <tt>c</tt> does not support null elements, or |
3464 |
> |
* null values and <tt>c</tt> does not permit null elements, or |
3465 |
|
* if <tt>c</tt> or <tt>elements</tt> are <tt>null</tt> |
3466 |
< |
* @throws IllegalArgumentException if some aspect of a value in |
3466 |
> |
* @throws IllegalArgumentException if some property of a value in |
3467 |
|
* <tt>elements</tt> prevents it from being added to <tt>c</tt> |
3468 |
|
* @see Collection#addAll(Collection) |
3469 |
|
* @since 1.5 |