--- jsr166/src/jsr166x/ConcurrentSkipListMap.java 2012/11/25 21:06:56 1.19 +++ jsr166/src/jsr166x/ConcurrentSkipListMap.java 2012/12/29 23:55:19 1.20 @@ -599,7 +599,7 @@ public class ConcurrentSkipListMap /** * Returns the key corresponding to this entry. * - * @return the key corresponding to this entry. + * @return the key corresponding to this entry */ public K getKey() { return key; @@ -608,7 +608,7 @@ public class ConcurrentSkipListMap /** * Returns the value corresponding to this entry. * - * @return the value corresponding to this entry. + * @return the value corresponding to this entry */ public V getValue() { return value; @@ -616,7 +616,7 @@ public class ConcurrentSkipListMap /** * Always fails, throwing UnsupportedOperationException. - * @throws UnsupportedOperationException always. + * @throws UnsupportedOperationException always */ public V setValue(V value) { throw new UnsupportedOperationException(); @@ -646,7 +646,7 @@ public class ConcurrentSkipListMap * Returns a String consisting of the key followed by an * equals sign ("=") followed by the associated * value. - * @return a String representation of this entry. + * @return a String representation of this entry */ public String toString() { return getKey() + "=" + getValue(); @@ -807,7 +807,7 @@ public class ConcurrentSkipListMap * were performed. * * @param key the key - * @return node holding key, or null if no such. + * @return node holding key, or null if no such */ private Node findNode(Comparable key) { for (;;) { @@ -1378,7 +1378,7 @@ public class ConcurrentSkipListMap * last valid node. Needed by doRemoveLast. It is possible that * all successors of returned node will have been deleted upon * return, in which case this method can be retried. - * @return likely predecessor of last node. + * @return likely predecessor of last node */ private Node findPredecessorOfLast() { for (;;) { @@ -1586,10 +1586,10 @@ public class ConcurrentSkipListMap * Constructs a new map containing the same mappings as the given map, * sorted according to the keys' natural order. * - * @param m the map whose mappings are to be placed in this map. + * @param m the map whose mappings are to be placed in this map * @throws ClassCastException if the keys in m are not Comparable, or - * are not mutually comparable. - * @throws NullPointerException if the specified map is null. + * are not mutually comparable + * @throws NullPointerException if the specified map is null */ public ConcurrentSkipListMap(Map m) { this.comparator = null; @@ -1615,7 +1615,7 @@ public class ConcurrentSkipListMap * Returns a shallow copy of this Map instance. (The keys and * values themselves are not cloned.) * - * @return a shallow copy of this Map. + * @return a shallow copy of this Map */ public Object clone() { ConcurrentSkipListMap clone = null; @@ -1779,12 +1779,12 @@ public class ConcurrentSkipListMap /** * Returns true if this map contains a mapping for the specified * key. - * @param key key whose presence in this map is to be tested. + * @param key key whose presence in this map is to be tested * @return true if this map contains a mapping for the - * specified key. + * specified key * @throws ClassCastException if the key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if the key is null. + * currently in the map + * @throws NullPointerException if the key is null */ public boolean containsKey(Object key) { return doGet(key) != null; @@ -1794,12 +1794,12 @@ public class ConcurrentSkipListMap * Returns the value to which this map maps the specified key. Returns * null if the map contains no mapping for this key. * - * @param key key whose associated value is to be returned. + * @param key key whose associated value is to be returned * @return the value to which this map maps the specified key, or - * null if the map contains no mapping for the key. + * null if the map contains no mapping for the key * @throws ClassCastException if the key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if the key is null. + * currently in the map + * @throws NullPointerException if the key is null */ public V get(Object key) { return doGet(key); @@ -1810,14 +1810,14 @@ public class ConcurrentSkipListMap * If the map previously contained a mapping for this key, the old * value is replaced. * - * @param key key with which the specified value is to be associated. - * @param value value to be associated with the specified key. + * @param key key with which the specified value is to be associated + * @param value value to be associated with the specified key * * @return previous value associated with specified key, or null - * if there was no mapping for key. + * if there was no mapping for key * @throws ClassCastException if the key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if the key or value are null. + * currently in the map + * @throws NullPointerException if the key or value are null */ public V put(K key, V value) { if (value == null) @@ -1830,11 +1830,11 @@ public class ConcurrentSkipListMap * * @param key key for which mapping should be removed * @return previous value associated with specified key, or null - * if there was no mapping for key. + * if there was no mapping for key * * @throws ClassCastException if the key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if the key is null. + * currently in the map + * @throws NullPointerException if the key is null */ public V remove(Object key) { return doRemove(key, null); @@ -1845,10 +1845,10 @@ public class ConcurrentSkipListMap * specified value. This operation requires time linear in the * Map size. * - * @param value value whose presence in this Map is to be tested. + * @param value value whose presence in this Map is to be tested * @return true if a mapping to value exists; - * false otherwise. - * @throws NullPointerException if the value is null. + * false otherwise + * @throws NullPointerException if the value is null */ public boolean containsValue(Object value) { if (value == null) @@ -1875,7 +1875,7 @@ public class ConcurrentSkipListMap * will be inaccurate. Thus, this method is typically not very * useful in concurrent applications. * - * @return the number of elements in this map. + * @return the number of elements in this map */ public int size() { long count = 0; @@ -1888,7 +1888,7 @@ public class ConcurrentSkipListMap /** * Returns true if this map contains no key-value mappings. - * @return true if this map contains no key-value mappings. + * @return true if this map contains no key-value mappings */ public boolean isEmpty() { return findFirst() == null; @@ -1915,7 +1915,7 @@ public class ConcurrentSkipListMap * construction of the iterator, and may (but is not guaranteed to) * reflect any modifications subsequent to construction. * - * @return a set view of the keys contained in this map. + * @return a set view of the keys contained in this map */ public Set keySet() { /* @@ -1946,7 +1946,7 @@ public class ConcurrentSkipListMap * construction of the iterator, and may (but is not guaranteed * to) reflect any modifications subsequent to construction. * - * @return a set view of the keys contained in this map. + * @return a set view of the keys contained in this map */ public Set descendingKeySet() { /* @@ -1978,7 +1978,7 @@ public class ConcurrentSkipListMap * iterator, and may (but is not guaranteed to) reflect any * modifications subsequent to construction. * - * @return a collection view of the values contained in this map. + * @return a collection view of the values contained in this map */ public Collection values() { Values vs = values; @@ -2005,7 +2005,7 @@ public class ConcurrentSkipListMap * iterator.next() do not support the * setValue operation. * - * @return a collection view of the mappings contained in this map. + * @return a collection view of the mappings contained in this map */ public Set> entrySet() { EntrySet es = entrySet; @@ -2032,7 +2032,7 @@ public class ConcurrentSkipListMap * iterator.next() do not support the * setValue operation. * - * @return a collection view of the mappings contained in this map. + * @return a collection view of the mappings contained in this map */ public Set> descendingEntrySet() { DescendingEntrySet es = descendingEntrySet; @@ -2052,8 +2052,8 @@ public class ConcurrentSkipListMap * operation may return misleading results if either map is * concurrently modified during execution of this method. * - * @param o object to be compared for equality with this map. - * @return true if the specified object is equal to this map. + * @param o object to be compared for equality with this map + * @return true if the specified object is equal to this map */ public boolean equals(Object o) { if (o == this) @@ -2099,14 +2099,14 @@ public class ConcurrentSkipListMap * return map.get(key); * * except that the action is performed atomically. - * @param key key with which the specified value is to be associated. - * @param value value to be associated with the specified key. + * @param key key with which the specified value is to be associated + * @param value value to be associated with the specified key * @return previous value associated with specified key, or null - * if there was no mapping for key. + * if there was no mapping for key * * @throws ClassCastException if the key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if the key or value are null. + * currently in the map + * @throws NullPointerException if the key or value are null */ public V putIfAbsent(K key, V value) { if (value == null) @@ -2124,12 +2124,12 @@ public class ConcurrentSkipListMap * } else return false; * * except that the action is performed atomically. - * @param key key with which the specified value is associated. - * @param value value associated with the specified key. + * @param key key with which the specified value is associated + * @param value value associated with the specified key * @return true if the value was removed, false otherwise * @throws ClassCastException if the key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if the key or value are null. + * currently in the map + * @throws NullPointerException if the key or value are null */ public boolean remove(Object key, Object value) { if (value == null) @@ -2147,14 +2147,14 @@ public class ConcurrentSkipListMap * } else return false; * * except that the action is performed atomically. - * @param key key with which the specified value is associated. - * @param oldValue value expected to be associated with the specified key. - * @param newValue value to be associated with the specified key. + * @param key key with which the specified value is associated + * @param oldValue value expected to be associated with the specified key + * @param newValue value to be associated with the specified key * @return true if the value was replaced * @throws ClassCastException if the key cannot be compared with the keys - * currently in the map. + * currently in the map * @throws NullPointerException if key, oldValue or newValue are - * null. + * null */ public boolean replace(K key, V oldValue, V newValue) { if (oldValue == null || newValue == null) @@ -2183,13 +2183,13 @@ public class ConcurrentSkipListMap * } else return null; * * except that the action is performed atomically. - * @param key key with which the specified value is associated. - * @param value value to be associated with the specified key. + * @param key key with which the specified value is associated + * @param value value to be associated with the specified key * @return previous value associated with specified key, or null - * if there was no mapping for key. + * if there was no mapping for key * @throws ClassCastException if the key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if the key or value are null. + * currently in the map + * @throws NullPointerException if the key or value are null */ public V replace(K key, V value) { if (value == null) @@ -2221,8 +2221,8 @@ public class ConcurrentSkipListMap /** * Returns the first (lowest) key currently in this map. * - * @return the first (lowest) key currently in this map. - * @throws NoSuchElementException Map is empty. + * @return the first (lowest) key currently in this map + * @throws NoSuchElementException Map is empty */ public K firstKey() { Node n = findFirst(); @@ -2234,8 +2234,8 @@ public class ConcurrentSkipListMap /** * Returns the last (highest) key currently in this map. * - * @return the last (highest) key currently in this map. - * @throws NoSuchElementException Map is empty. + * @return the last (highest) key currently in this map + * @throws NoSuchElementException Map is empty */ public K lastKey() { Node n = findLast(); @@ -2251,19 +2251,19 @@ public class ConcurrentSkipListMap * is empty.) The returned sorted map is backed by this map, so changes * in the returned sorted map are reflected in this map, and vice-versa. * - * @param fromKey low endpoint (inclusive) of the subMap. - * @param toKey high endpoint (exclusive) of the subMap. + * @param fromKey low endpoint (inclusive) of the subMap + * @param toKey high endpoint (exclusive) of the subMap * * @return a view of the portion of this map whose keys range from - * fromKey, inclusive, to toKey, exclusive. + * fromKey, inclusive, to toKey, exclusive * * @throws ClassCastException if fromKey and toKey * cannot be compared to one another using this map's comparator - * (or, if the map has no comparator, using natural ordering). + * (or, if the map has no comparator, using natural ordering) * @throws IllegalArgumentException if fromKey is greater than - * toKey. + * toKey * @throws NullPointerException if fromKey or toKey is - * null. + * null */ public ConcurrentNavigableMap subMap(K fromKey, K toKey) { if (fromKey == null || toKey == null) @@ -2276,14 +2276,14 @@ public class ConcurrentSkipListMap * strictly less than toKey. The returned sorted map is * backed by this map, so changes in the returned sorted map are * reflected in this map, and vice-versa. - * @param toKey high endpoint (exclusive) of the headMap. + * @param toKey high endpoint (exclusive) of the headMap * @return a view of the portion of this map whose keys are - * strictly less than toKey. + * strictly less than toKey * * @throws ClassCastException if toKey is not compatible * with this map's comparator (or, if the map has no comparator, - * if toKey does not implement Comparable). - * @throws NullPointerException if toKey is null. + * if toKey does not implement Comparable) + * @throws NullPointerException if toKey is null */ public ConcurrentNavigableMap headMap(K toKey) { if (toKey == null) @@ -2296,14 +2296,14 @@ public class ConcurrentSkipListMap * greater than or equal to fromKey. The returned sorted * map is backed by this map, so changes in the returned sorted * map are reflected in this map, and vice-versa. - * @param fromKey low endpoint (inclusive) of the tailMap. + * @param fromKey low endpoint (inclusive) of the tailMap * @return a view of the portion of this map whose keys are - * greater than or equal to fromKey. + * greater than or equal to fromKey * @throws ClassCastException if fromKey is not * compatible with this map's comparator (or, if the map has no * comparator, if fromKey does not implement - * Comparable). - * @throws NullPointerException if fromKey is null. + * Comparable) + * @throws NullPointerException if fromKey is null */ public ConcurrentNavigableMap tailMap(K fromKey) { if (fromKey == null) @@ -2319,12 +2319,12 @@ public class ConcurrentSkipListMap * there is no such entry. The returned entry does not * support the Entry.setValue method. * - * @param key the key. + * @param key the key * @return an Entry associated with ceiling of given key, or - * null if there is no such Entry. + * null if there is no such Entry * @throws ClassCastException if key cannot be compared with the - * keys currently in the map. - * @throws NullPointerException if key is null. + * keys currently in the map + * @throws NullPointerException if key is null */ public Map.Entry ceilingEntry(K key) { return getNear(key, GT|EQ); @@ -2334,12 +2334,12 @@ public class ConcurrentSkipListMap * Returns least key greater than or equal to the given key, or * null if there is no such key. * - * @param key the key. + * @param key the key * @return the ceiling key, or null - * if there is no such key. + * if there is no such key * @throws ClassCastException if key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if key is null. + * currently in the map + * @throws NullPointerException if key is null */ public K ceilingKey(K key) { Node n = findNear(key, GT|EQ); @@ -2352,12 +2352,12 @@ public class ConcurrentSkipListMap * such entry. The returned entry does not support * the Entry.setValue method. * - * @param key the key. + * @param key the key * @return an Entry with greatest key less than the given - * key, or null if there is no such Entry. + * key, or null if there is no such Entry * @throws ClassCastException if key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if key is null. + * currently in the map + * @throws NullPointerException if key is null */ public Map.Entry lowerEntry(K key) { return getNear(key, LT); @@ -2367,12 +2367,12 @@ public class ConcurrentSkipListMap * Returns the greatest key strictly less than the given key, or * null if there is no such key. * - * @param key the key. + * @param key the key * @return the greatest key less than the given - * key, or null if there is no such key. + * key, or null if there is no such key * @throws ClassCastException if key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if key is null. + * currently in the map + * @throws NullPointerException if key is null */ public K lowerKey(K key) { Node n = findNear(key, LT); @@ -2385,12 +2385,12 @@ public class ConcurrentSkipListMap * is no such entry. The returned entry does not support * the Entry.setValue method. * - * @param key the key. + * @param key the key * @return an Entry associated with floor of given key, or null - * if there is no such Entry. + * if there is no such Entry * @throws ClassCastException if key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if key is null. + * currently in the map + * @throws NullPointerException if key is null */ public Map.Entry floorEntry(K key) { return getNear(key, LT|EQ); @@ -2401,12 +2401,12 @@ public class ConcurrentSkipListMap * less than or equal to the given key, or null if there * is no such key. * - * @param key the key. + * @param key the key * @return the floor of given key, or null if there is no - * such key. + * such key * @throws ClassCastException if key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if key is null. + * currently in the map + * @throws NullPointerException if key is null */ public K floorKey(K key) { Node n = findNear(key, LT|EQ); @@ -2419,12 +2419,12 @@ public class ConcurrentSkipListMap * is no such entry. The returned entry does not support * the Entry.setValue method. * - * @param key the key. + * @param key the key * @return an Entry with least key greater than the given key, or - * null if there is no such Entry. + * null if there is no such Entry * @throws ClassCastException if key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if key is null. + * currently in the map + * @throws NullPointerException if key is null */ public Map.Entry higherEntry(K key) { return getNear(key, GT); @@ -2434,12 +2434,12 @@ public class ConcurrentSkipListMap * Returns the least key strictly greater than the given key, or * null if there is no such key. * - * @param key the key. + * @param key the key * @return the least key greater than the given key, or - * null if there is no such key. + * null if there is no such key * @throws ClassCastException if key cannot be compared with the keys - * currently in the map. - * @throws NullPointerException if key is null. + * currently in the map + * @throws NullPointerException if key is null */ public K higherKey(K key) { Node n = findNear(key, GT); @@ -2453,7 +2453,7 @@ public class ConcurrentSkipListMap * the Entry.setValue method. * * @return an Entry with least key, or null - * if the map is empty. + * if the map is empty */ public Map.Entry firstEntry() { for (;;) { @@ -2473,7 +2473,7 @@ public class ConcurrentSkipListMap * the Entry.setValue method. * * @return an Entry with greatest key, or null - * if the map is empty. + * if the map is empty */ public Map.Entry lastEntry() { for (;;) { @@ -2493,7 +2493,7 @@ public class ConcurrentSkipListMap * the Entry.setValue method. * * @return the removed first entry of this map, or null - * if the map is empty. + * if the map is empty */ public Map.Entry pollFirstEntry() { return (SnapshotEntry)doRemoveFirst(false); @@ -2506,7 +2506,7 @@ public class ConcurrentSkipListMap * the Entry.setValue method. * * @return the removed last entry of this map, or null - * if the map is empty. + * if the map is empty */ public Map.Entry pollLastEntry() { return (SnapshotEntry)doRemoveLast(false);