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

Comparing jsr166/src/jsr166x/ConcurrentSkipListMap.java (file contents):
Revision 1.24 by jsr166, Sat Jan 19 21:53:46 2013 UTC vs.
Revision 1.33 by jsr166, Tue Oct 22 15:21:30 2013 UTC

# Line 212 | Line 212 | public class ConcurrentSkipListMap<K,V>
212       * highly contended cases.
213       *
214       * Unlike most skip-list implementations, index insertion and
215 <     * deletion here require a separate traversal pass occuring after
215 >     * deletion here require a separate traversal pass occurring after
216       * the base-level action, to add or remove index nodes.  This adds
217       * to single-threaded overhead, but improves contended
218       * multithreaded performance by narrowing interference windows,
# Line 419 | Line 419 | public class ConcurrentSkipListMap<K,V>
419           * because callers will have already read value field and need
420           * to use that read (not another done here) and so directly
421           * test if value points to node.
422 <         * @param n a possibly null reference to a node
422 >         *
423           * @return true if this node is a marker node
424           */
425          boolean isMarker() {
# Line 468 | Line 468 | public class ConcurrentSkipListMap<K,V>
468           * Returns value if this node contains a valid key-value pair,
469           * else null.
470           * @return this node's value if it isn't a marker or header or
471 <         * is deleted, else null.
471 >         * is deleted, else null
472           */
473          V getValidValue() {
474              Object v = value;
# Line 507 | Line 507 | public class ConcurrentSkipListMap<K,V>
507          volatile Index<K,V> right;
508  
509          /**
510 <         * Creates index node with given values
510 >         * Creates index node with given values.
511           */
512          Index(Node<K,V> node, Index<K,V> down, Index<K,V> right) {
513              this.node = node;
# Line 766 | Line 766 | public class ConcurrentSkipListMap<K,V>
766      }
767  
768      /**
769 <     * Returns node holding key or null if no such, clearing out any
769 >     * Returns node holding key, or null if no such, clearing out any
770       * deleted nodes seen along the way.  Repeatedly traverses at
771       * base-level looking for key starting at predecessor returned
772       * from findPredecessor, processing base-level deletions as
# Line 917 | Line 917 | public class ConcurrentSkipListMap<K,V>
917       * Main insertion method.  Adds element if not present, or
918       * replaces value if present and onlyIfAbsent is false.
919       * @param kkey the key
920 <     * @param value  the value that must be associated with key
920 >     * @param value the value that must be associated with key
921       * @param onlyIfAbsent if should not insert if already present
922       * @return the old value, or null if newly inserted
923       */
# Line 1042 | Line 1042 | public class ConcurrentSkipListMap<K,V>
1042       * Adds given index nodes from given level down to 1.
1043       * @param idx the topmost index node being inserted
1044       * @param h the value of head to use to insert. This must be
1045 <     * snapshotted by callers to provide correct insertion level
1045 >     * snapshotted by callers to provide correct insertion level.
1046       * @param indexLevel the level of the index
1047       */
1048      private void addIndex(Index<K,V> idx, HeadIndex<K,V> h, int indexLevel) {
# Line 1601 | Line 1601 | public class ConcurrentSkipListMap<K,V>
1601       * Constructs a new map containing the same mappings as the given
1602       * {@code SortedMap}, sorted according to the same ordering.
1603       * @param m the sorted map whose mappings are to be placed in this
1604 <     * map, and whose comparator is to be used to sort this map.
1604 >     * map, and whose comparator is to be used to sort this map
1605       * @throws NullPointerException if the specified sorted map is
1606 <     * {@code null}.
1606 >     * {@code null}
1607       */
1608      public ConcurrentSkipListMap(SortedMap<K, ? extends V> m) {
1609          this.comparator = m.comparator();
# Line 2212 | Line 2212 | public class ConcurrentSkipListMap<K,V>
2212       * if this map uses its keys' natural order.
2213       *
2214       * @return the comparator associated with this map, or
2215 <     * {@code null} if it uses its keys' natural sort method.
2215 >     * {@code null} if it uses its keys' natural sort method
2216       */
2217      public Comparator<? super K> comparator() {
2218          return comparator;
# Line 2842 | Line 2842 | public class ConcurrentSkipListMap<K,V>
2842      }
2843  
2844      final class DescendingEntryIterator extends EntryIter
2845 <        implements Iterator<Map.Entry<K,V>>  {
2845 >        implements Iterator<Map.Entry<K,V>> {
2846          DescendingEntryIterator() {
2847              initDescending();
2848          }
# Line 2854 | Line 2854 | public class ConcurrentSkipListMap<K,V>
2854      }
2855  
2856      final class DescendingSubMapEntryIterator extends EntryIter
2857 <        implements Iterator<Map.Entry<K,V>>  {
2857 >        implements Iterator<Map.Entry<K,V>> {
2858          final K least;
2859          DescendingSubMapEntryIterator(K least, K fence) {
2860              initDescending(least, fence);
# Line 3049 | Line 3049 | public class ConcurrentSkipListMap<K,V>
3049          /**
3050           * Creates a new submap.
3051           * @param least inclusive least value, or {@code null} if from start
3052 <         * @param fence exclusive upper bound or {@code null} if to end
3052 >         * @param fence exclusive upper bound, or {@code null} if to end
3053           * @throws IllegalArgumentException if least and fence non-null
3054           *  and least greater than fence
3055           */
# Line 3104 | Line 3104 | public class ConcurrentSkipListMap<K,V>
3104  
3105          /**
3106           * Returns least key. Needed by ConcurrentSkipListSet.
3107 <         * @return least key or {@code null} if from start
3107 >         * @return least key, or {@code null} if from start
3108           */
3109          K getLeast() {
3110              return least;
# Line 3112 | Line 3112 | public class ConcurrentSkipListMap<K,V>
3112  
3113          /**
3114           * Returns fence key. Needed by ConcurrentSkipListSet.
3115 <         * @return fence key or {@code null} of to end
3115 >         * @return fence key, or {@code null} if to end
3116           */
3117          K getFence() {
3118              return fence;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines