ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/TreeSet.java
(Generate patch)

Comparing jsr166/src/main/java/util/TreeSet.java (file contents):
Revision 1.17 by jsr166, Fri Jun 24 20:44:49 2005 UTC vs.
Revision 1.20 by jsr166, Tue Feb 7 20:54:24 2006 UTC

# Line 1 | Line 1
1   /*
2   * %W% %E%
3   *
4 < * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
4 > * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5   * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6   */
7  
8   package java.util;
9 import java.util.*; // for javadoc (till 6280605 is fixed)
9  
10   /**
11   * A {@link NavigableSet} implementation based on a {@link TreeMap}.
# Line 29 | Line 28 | import java.util.*; // for javadoc (till
28   * <i>is</i> well-defined even if its ordering is inconsistent with equals; it
29   * just fails to obey the general contract of the <tt>Set</tt> interface.
30   *
31 < * <p><b>Note that this implementation is not synchronized.</b> If multiple
32 < * threads access a set concurrently, and at least one of the threads modifies
33 < * the set, it <i>must</i> be synchronized externally.  This is typically
34 < * accomplished by synchronizing on some object that naturally encapsulates
35 < * the set.  If no such object exists, the set should be "wrapped" using the
36 < * <tt>Collections.synchronizedSet</tt> method.  This is best done at creation
37 < * time, to prevent accidental unsynchronized access to the set: <pre>
38 < *     SortedSet s = Collections.synchronizedSortedSet(new TreeSet(...));
39 < * </pre>
31 > * <p><strong>Note that this implementation is not synchronized.</strong>
32 > * If multiple threads access a tree set concurrently, and at least one
33 > * of the threads modifies the set, it <i>must</i> be synchronized
34 > * externally.  This is typically accomplished by synchronizing on some
35 > * object that naturally encapsulates the set.
36 > * If no such object exists, the set should be "wrapped" using the
37 > * {@link Collections#synchronizedSortedSet Collections.synchronizedSortedSet}
38 > * method.  This is best done at creation time, to prevent accidental
39 > * unsynchronized access to the set: <pre>
40 > *   SortedSet s = Collections.synchronizedSortedSet(new TreeSet(...));</pre>
41   *
42   * <p>The iterators returned by this class's <tt>iterator</tt> method are
43   * <i>fail-fast</i>: if the set is modified at any time after the iterator is
# Line 68 | Line 68 | import java.util.*; // for javadoc (till
68   * @see     HashSet
69   * @see     Comparable
70   * @see     Comparator
71 * @see     Collections#synchronizedSortedSet(SortedSet)
71   * @see     TreeMap
72   * @since   1.2
73   */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines