--- jsr166/src/extra166y/CustomConcurrentHashMap.java 2013/01/09 02:51:36 1.25 +++ jsr166/src/extra166y/CustomConcurrentHashMap.java 2013/01/16 00:51:11 1.26 @@ -25,15 +25,15 @@ import sun.misc.Unsafe; *
  • {@linkplain SoftReference Soft}, {@linkplain * WeakReference weak} or strong (regular) keys and values. * - *
  • User-definable MappingFunctions that may be + *
  • User-definable {@code MappingFunctions} that may be * used in method {@link * CustomConcurrentHashMap#computeIfAbsent} to atomically * establish a computed value, along with - * RemappingFunctions that can be used in method + * {@code RemappingFunctions} that can be used in method * {@link CustomConcurrentHashMap#compute} to atomically * replace values. * - *
  • Factory methods returning specialized forms for int + *
  • Factory methods returning specialized forms for {@code int} * keys and/or values, that may be more space-efficient * * @@ -72,24 +72,24 @@ import sun.misc.Unsafe; * *

    This class also includes nested class {@link KeySet} * that provides space-efficient Set views of maps, also supporting - * method intern, which may be of use in canonicalizing + * method {@code intern}, which may be of use in canonicalizing * elements. * *

    When used with (Weak or Soft) Reference keys and/or values, - * elements that have asynchronously become null are + * elements that have asynchronously become {@code null} are * treated as absent from the map and (eventually) removed from maps * via a background thread common across all maps. Because of the * potential for asynchronous clearing of References, methods such as - * containsValue have weaker guarantees than you might + * {@code containsValue} have weaker guarantees than you might * expect even in the absence of other explicitly concurrent - * operations. For example containsValue(value) may - * return true even if value is no longer available upon + * operations. For example {@code containsValue(value)} may + * return true even if {@code value} is no longer available upon * return from the method. * *

    When Equivalences other than equality are used, the returned - * collections may violate the specifications of Map and/or - * Set interfaces, which mandate the use of the - * equals method when comparing objects. The methods of this + * collections may violate the specifications of {@code Map} and/or + * {@code Set} interfaces, which mandate the use of the + * {@code equals} method when comparing objects. The methods of this * class otherwise have properties similar to those of {@link * java.util.ConcurrentHashMap} under its default settings. To * adaptively maintain semantics and performance under varying @@ -165,8 +165,8 @@ public class CustomConcurrentHashMapK may be - * entered into a Map, any Object may be tested for + * java.util.Map}: While only elements of {@code K} may be + * entered into a Map, any {@code Object} may be tested for * membership. Note that the performance of hash maps is heavily * dependent on the quality of hash functions. */ @@ -224,7 +224,7 @@ public class CustomConcurrentHashMapnull if there is no mapping. + * or {@code null} if there is no mapping. */ public static interface MappingFunction { /** @@ -244,7 +244,7 @@ public class CustomConcurrentHashMapnull if there is + * current value to a new value, or {@code null} if there is * no mapping */ public static interface RemappingFunction { @@ -678,11 +678,11 @@ public class CustomConcurrentHashMaptrue if this map contains a key equivalent to + * Returns {@code true} if this map contains a key equivalent to * the given key with respect to this map's key Equivalence. * * @param key possible key - * @return true if this map contains the specified key + * @return {@code true} if this map contains the specified key * @throws NullPointerException if the specified key is null */ public boolean containsKey(Object key) { @@ -700,7 +700,7 @@ public class CustomConcurrentHashMapnull if + * @return the value associated with the key or {@code null} if * there is no mapping. * @throws NullPointerException if the specified key is null */ @@ -752,8 +752,8 @@ public class CustomConcurrentHashMapkey, or - * null if there was no mapping for key + * @return the previous value associated with {@code key}, or + * {@code null} if there was no mapping for {@code key} * @throws NullPointerException if the specified key or value is null */ public V put(K key, V value) { @@ -764,7 +764,7 @@ public class CustomConcurrentHashMapnull if there was no mapping for the key + * or {@code null} if there was no mapping for the key * @throws NullPointerException if the specified key or value is null */ public V putIfAbsent(K key, V value) { @@ -813,7 +813,7 @@ public class CustomConcurrentHashMapnull if there was no mapping for the key + * or {@code null} if there was no mapping for the key * @throws NullPointerException if the specified key or value is null */ public boolean replace(K key, V oldValue, V newValue) { @@ -845,8 +845,8 @@ public class CustomConcurrentHashMapkey, or - * null if there was no mapping for key + * @return the previous value associated with {@code key}, or + * {@code null} if there was no mapping for {@code key} * @throws NullPointerException if the specified key is null */ public V remove(Object key) { @@ -979,9 +979,9 @@ public class CustomConcurrentHashMaptrue if this map contains no key-value mappings. + * Returns {@code true} if this map contains no key-value mappings. * - * @return true if this map contains no key-value mappings + * @return {@code true} if this map contains no key-value mappings */ public final boolean isEmpty() { final Segment[] segs = this.segments; @@ -997,8 +997,8 @@ public class CustomConcurrentHashMapInteger.MAX_VALUE elements, returns - * Integer.MAX_VALUE. + * map contains more than {@code Integer.MAX_VALUE} elements, returns + * {@code Integer.MAX_VALUE}. * * @return the number of key-value mappings in this map */ @@ -1014,14 +1014,14 @@ public class CustomConcurrentHashMaptrue if this map maps one or more keys to a + * Returns {@code true} if this map maps one or more keys to a * value equivalent to the given value with respect to this map's * value Equivalence. Note: This method requires a full internal * traversal of the hash table, and so is much slower than method - * containsKey. + * {@code containsKey}. * * @param value value whose presence in this map is to be tested - * @return true if this map maps one or more keys to the + * @return {@code true} if this map maps one or more keys to the * specified value * @throws NullPointerException if the specified value is null */ @@ -1091,8 +1091,8 @@ public class CustomConcurrentHashMapnull if the computation - * returned null. + * the specified key, or {@code null} if the computation + * returned {@code null}. * @throws NullPointerException if the specified key or mappingFunction * is null, * @throws RuntimeException or Error if the mappingFunction does so, @@ -1165,7 +1165,7 @@ public class CustomConcurrentHashMapnull if the computation returned null + * {@code null} if the computation returned {@code null} * @throws NullPointerException if the specified key or remappingFunction * is null, * @throws RuntimeException or Error if the remappingFunction does so, @@ -1433,12 +1433,12 @@ public class CustomConcurrentHashMapIterator.remove, Set.remove, - * removeAll, retainAll, and clear - * operations. It does not support the add or - * addAll operations. + * via the {@code Iterator.remove}, {@code Set.remove}, + * {@code removeAll}, {@code retainAll}, and {@code clear} + * operations. It does not support the {@code add} or + * {@code addAll} operations. * - *

    The view's iterator is a "weakly consistent" iterator + *

    The view's {@code iterator} is a "weakly consistent" iterator * that will never throw {@link ConcurrentModificationException}, * and guarantees to traverse elements as they existed upon * construction of the iterator, and may (but is not guaranteed to) @@ -1454,12 +1454,12 @@ public class CustomConcurrentHashMapIterator.remove, - * Collection.remove, removeAll, - * retainAll, and clear operations. It does not - * support the add or addAll operations. + * mapping from this map, via the {@code Iterator.remove}, + * {@code Collection.remove}, {@code removeAll}, + * {@code retainAll}, and {@code clear} operations. It does not + * support the {@code add} or {@code addAll} operations. * - *

    The view's iterator is a "weakly consistent" iterator + *

    The view's {@code iterator} is a "weakly consistent" iterator * that will never throw {@link ConcurrentModificationException}, * and guarantees to traverse elements as they existed upon * construction of the iterator, and may (but is not guaranteed to) @@ -1475,12 +1475,12 @@ public class CustomConcurrentHashMapIterator.remove, Set.remove, - * removeAll, retainAll, and clear - * operations. It does not support the add or - * addAll operations. + * via the {@code Iterator.remove}, {@code Set.remove}, + * {@code removeAll}, {@code retainAll}, and {@code clear} + * operations. It does not support the {@code add} or + * {@code addAll} operations. * - *

    The view's iterator is a "weakly consistent" iterator + *

    The view's {@code iterator} is a "weakly consistent" iterator * that will never throw {@link ConcurrentModificationException}, * and guarantees to traverse elements as they existed upon * construction of the iterator, and may (but is not guaranteed to) @@ -1495,13 +1495,13 @@ public class CustomConcurrentHashMaptrue if the given object is also a map of the + * Returns {@code true} if the given object is also a map of the * same size, holding keys that are equal using this Map's key * Equivalence, and which map to values that are equal according * to this Map's value equivalence. * * @param o object to be compared for equality with this map - * @return true if the specified object is equal to this map + * @return {@code true} if the specified object is equal to this map */ public boolean equals(Object o) { if (o == this) @@ -1538,7 +1538,7 @@ public class CustomConcurrentHashMapentrySet() view, which in turn are the hash codes + * {@code entrySet()} view, which in turn are the hash codes * computed using key and value Equivalences for this Map. * @return the hash code */ @@ -1588,8 +1588,8 @@ public class CustomConcurrentHashMapCollections.newSetFromMap applied to a - * CustomConcurrentHashMap, but possibly more + * {@code Collections.newSetFromMap} applied to a + * {@code CustomConcurrentHashMap}, but possibly more * space-efficient. The set does not permit null elements. The * set is serializable; however, serializing a set that uses soft * or weak references can give unpredictable results. @@ -1629,11 +1629,11 @@ public class CustomConcurrentHashMaptrue if this set contains an + * Returns {@code true} if this set contains an * element equivalent to the given element with respect * to this set's Equivalence. * @param o element whose presence in this set is to be tested - * @return true if this set contains the specified element + * @return {@code true} if this set contains the specified element */ public boolean contains(Object o) { return cchm.containsKey(o); @@ -1656,7 +1656,7 @@ public class CustomConcurrentHashMaptrue if this set did not already contain + * @return {@code true} if this set did not already contain * the specified element */ public boolean add(K e) { @@ -1668,16 +1668,16 @@ public class CustomConcurrentHashMaptrue if the set contained the specified element + * @return {@code true} if the set contained the specified element */ public boolean remove(Object o) { return cchm.remove(o) != null; } /** - * Returns true if this set contains no elements. + * Returns {@code true} if this set contains no elements. * - * @return true if this set contains no elements + * @return {@code true} if this set contains no elements */ public boolean isEmpty() { return cchm.isEmpty();