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

Comparing jsr166/src/main/java/util/concurrent/ConcurrentSkipListMap.java (file contents):
Revision 1.27 by dl, Sat May 28 13:30:40 2005 UTC vs.
Revision 1.28 by jsr166, Sat May 28 14:56:21 2005 UTC

# Line 1146 | Line 1146 | public class ConcurrentSkipListMap<K,V>
1146      }
1147  
1148      /**
1149 <     * Removes first entry; returns its key
1150 <     * @return null if empty or first key
1149 >     * Removes first entry; returns its key.
1150 >     * @return null if empty, else key of first entry
1151       */
1152      K doRemoveFirstKey() {
1153          for (;;) {
# Line 1175 | Line 1175 | public class ConcurrentSkipListMap<K,V>
1175  
1176      /**
1177       * Removes first entry; returns its snapshot.
1178 <     * @return null if empty, else key,value entry
1178 >     * @return null if empty, else snapshot of first entry
1179       */
1180      Map.Entry<K,V> doRemoveFirstEntry() {
1181          for (;;) {
# Line 1198 | Line 1198 | public class ConcurrentSkipListMap<K,V>
1198              clearIndexToFirst();
1199              K key = n.key;
1200              return new AbstractMap.SimpleImmutableEntry<K,V>(key, (V)v);
1201 <        }
1201 >        }
1202      }
1203  
1204      /**
# Line 1465 | Line 1465 | public class ConcurrentSkipListMap<K,V>
1465                  return null;
1466              K k = n.key;
1467              V v = n.getValidValue();
1468 <            if (v != null)
1468 >            if (v != null)
1469                  return k;
1470          }
1471      }
# Line 1497 | Line 1497 | public class ConcurrentSkipListMap<K,V>
1497                  return null;
1498              K k = n.key;
1499              V v = n.getValidValue();
1500 <            if (v != null)
1500 >            if (v != null)
1501                  return new AbstractMap.SimpleImmutableEntry<K,V>(k, v);
1502          }
1503      }
# Line 1517 | Line 1517 | public class ConcurrentSkipListMap<K,V>
1517              if (fence != null && compare(k, fence) >= 0)
1518                  return null;
1519              V v = doRemove(k, null);
1520 <            if (v != null)
1520 >            if (v != null)
1521                  return new AbstractMap.SimpleImmutableEntry<K,V>(k, v);
1522          }
1523      }
# Line 1537 | Line 1537 | public class ConcurrentSkipListMap<K,V>
1537              if (least != null && compare(k, least) < 0)
1538                  return null;
1539              V v = doRemove(k, null);
1540 <            if (v != null)
1540 >            if (v != null)
1541                  return new AbstractMap.SimpleImmutableEntry<K,V>(k, v);
1542          }
1543      }
# Line 2806 | Line 2806 | public class ConcurrentSkipListMap<K,V>
2806          public void clear() {
2807              ConcurrentSkipListMap.this.clear();
2808          }
2809
2809          public Object[] toArray() {
2810              Collection<K> c = new ArrayList<K>();
2811              for (Iterator<K> i = iterator(); i.hasNext(); )
# Line 2884 | Line 2883 | public class ConcurrentSkipListMap<K,V>
2883          public void clear() {
2884              ConcurrentSkipListMap.this.clear();
2885          }
2887
2886          public Object[] toArray() {
2887              Collection<Map.Entry<K,V>> c = new ArrayList<Map.Entry<K,V>>();
2888              for (Map.Entry<K,V> e : this)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines