--- jsr166/src/main/java/util/Collections.java 2005/04/18 05:18:29 1.3 +++ jsr166/src/main/java/util/Collections.java 2005/04/27 00:58:57 1.4 @@ -37,7 +37,7 @@ import java.lang.reflect.Array; * example, invoking the sort method on an unmodifiable list that is * already sorted may or may not throw UnsupportedOperationException. * - *
This class is a member of the + *
This class is a member of the * * Java Collections Framework. * @@ -97,7 +97,7 @@ public class Collections { * The sorting algorithm is a modified mergesort (in which the merge is * omitted if the highest element in the low sublist is less than the * lowest element in the high sublist). This algorithm offers guaranteed - * n log(n) performance. + * n log(n) performance. * * This implementation dumps the specified list into an array, sorts * the array, and iterates over the list resetting each element @@ -135,7 +135,7 @@ public class Collections { * The sorting algorithm is a modified mergesort (in which the merge is * omitted if the highest element in the low sublist is less than the * lowest element in the high sublist). This algorithm offers guaranteed - * n log(n) performance. + * n log(n) performance. * * The specified list must be modifiable, but need not be resizable. * This implementation dumps the specified list into an array, sorts @@ -361,7 +361,7 @@ public class Collections { * * @param list the list whose elements are to be reversed. * @throws UnsupportedOperationException if the specified list or - * its list-iterator does not support the set method. + * its list-iterator does not support the set operation. */ public static void reverse(List> list) { int size = list.size(); @@ -405,7 +405,7 @@ public class Collections { * * @param list the list to be shuffled. * @throws UnsupportedOperationException if the specified list or - * its list-iterator does not support the set method. + * its list-iterator does not support the set operation. */ public static void shuffle(List> list) { shuffle(list, r); @@ -712,7 +712,7 @@ public class Collections { * Collections.rotate(l.subList(1, 4), -1); * * The resulting list is [a, c, d, b, e]. - * + * *
To move more than one element forward, increase the absolute value
* of the rotation distance. To move elements backward, use a positive
* shift distance.
@@ -736,7 +736,7 @@ public class Collections {
* constraints on this value; it may be zero, negative, or
* greater than list.size().
* @throws UnsupportedOperationException if the specified list or
- * its list-iterator does not support the set method.
+ * its list-iterator does not support the set operation.
* @since 1.4
*/
public static void rotate(List> list, int distance) {
@@ -772,7 +772,7 @@ public class Collections {
private static void rotate2(List> list, int distance) {
int size = list.size();
if (size == 0)
- return;
+ return;
int mid = -distance % size;
if (mid < 0)
mid += size;
@@ -799,7 +799,7 @@ public class Collections {
* e such that
* (oldVal==null ? e==null : oldVal.equals(e)).
* @throws UnsupportedOperationException if the specified list or
- * its list-iterator does not support the set method.
+ * its list-iterator does not support the set operation.
* @since 1.4
*/
public static
*
* The returned collection will be serializable if the specified collection
- * is serializable.
+ * is serializable.
*
* @param c the collection for which an unmodifiable view is to be
* returned.
@@ -1046,7 +1046,7 @@ public class Collections {
* iterator, result in an UnsupportedOperationException.
*
* The returned set will be serializable if the specified set
- * is serializable.
+ * is serializable.
*
* @param s the set for which an unmodifiable view is to be returned.
* @return an unmodifiable view of the specified set.
@@ -1078,10 +1078,10 @@ public class Collections {
* an UnsupportedOperationException.
*
* The returned sorted set will be serializable if the specified sorted set
- * is serializable.
+ * is serializable.
*
* @param s the sorted set for which an unmodifiable view is to be
- * returned.
+ * returned.
* @return an unmodifiable view of the specified sorted set.
*/
public static
*
* The returned map will be serializable if the specified map
- * is serializable.
+ * is serializable.
*
* @param m the map for which an unmodifiable view is to be returned.
* @return an unmodifiable view of the specified map.
@@ -1334,7 +1334,7 @@ public class Collections {
private static final long serialVersionUID = 7854390611657943733L;
UnmodifiableEntrySet(Set extends Map.Entry extends K, ? extends V>> s) {
- super((Set
*
* The returned sorted map will be serializable if the specified sorted map
- * is serializable.
+ * is serializable.
*
* @param m the sorted map for which an unmodifiable view is to be
- * returned.
+ * returned.
* @return an unmodifiable view of the specified sorted map.
*/
public static
*
* The returned collection will be serializable if the specified collection
- * is serializable.
+ * is serializable.
*
* @param c the collection to be "wrapped" in a synchronized collection.
* @return a synchronized view of the specified collection.
@@ -1673,7 +1673,7 @@ public class Collections {
* sorted set when iterating over it or any of its subSet,
* headSet, or tailSet views.
*
- * SortedSet s = Collections.synchronizedSortedSet(new HashSortedSet());
+ * SortedSet s = Collections.synchronizedSortedSet(new TreeSet());
* ...
* synchronized(s) {
* Iterator i = s.iterator(); // Must be in the synchronized block
@@ -1683,7 +1683,7 @@ public class Collections {
*
* or:
*
- * SortedSet s = Collections.synchronizedSortedSet(new HashSortedSet());
+ * SortedSet s = Collections.synchronizedSortedSet(new TreeSet());
* SortedSet s2 = s.headSet(foo);
* ...
* synchronized(s) { // Note: s, not s2!!!
@@ -2007,7 +2007,7 @@ public class Collections {
public Set
- * SortedMap m = Collections.synchronizedSortedMap(new HashSortedMap());
+ * SortedMap m = Collections.synchronizedSortedMap(new TreeMap());
* ...
* Set s = m.keySet(); // Needn't be in synchronized block
* ...
@@ -2057,7 +2057,7 @@ public class Collections {
*
* or:
*
- * SortedMap m = Collections.synchronizedSortedMap(new HashSortedMap());
+ * SortedMap m = Collections.synchronizedSortedMap(new TreeMap());
* SortedMap m2 = m.subMap(foo, bar);
* ...
* Set s2 = m2.keySet(); // Needn't be in synchronized block
@@ -2191,7 +2191,7 @@ public class Collections {
Class