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

Comparing jsr166/src/main/java/util/AbstractMap.java (file contents):
Revision 1.1 by dl, Fri Dec 31 13:00:33 2004 UTC vs.
Revision 1.6 by jsr166, Mon Apr 18 05:18:29 2005 UTC

# Line 1 | Line 1
1   /*
2   * %W% %E%
3   *
4 < * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
4 > * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
5   * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6   */
7  
# Line 205 | Line 205 | public abstract class AbstractMap<K,V> i
205       * @param key key with which the specified value is to be associated.
206       * @param value value to be associated with the specified key.
207       *
208 <     * @return previous value associated with specified key, or <tt>null</tt>
208 >     * @return the previous value associated with specified key, or <tt>null</tt>
209       *         if there was no mapping for key.  (A <tt>null</tt> return can
210       *         also indicate that the map previously associated <tt>null</tt>
211       *         with the specified key, if the implementation supports
# Line 247 | Line 247 | public abstract class AbstractMap<K,V> i
247       * mapping for the specified key.
248       *
249       * @param key key whose mapping is to be removed from the map.
250 <     * @return previous value associated with specified key, or <tt>null</tt>
250 >     * @return the previous value associated with specified key, or <tt>null</tt>
251       *         if there was no entry for key.  (A <tt>null</tt> return can
252       *         also indicate that the map previously associated <tt>null</tt>
253       *         with the specified key, if the implementation supports
# Line 629 | Line 629 | public abstract class AbstractMap<K,V> i
629      // Implementation Note: SimpleEntry and SimpleImmutableEntry
630      // are distinct unrelated classes, even though they share
631      // some code. Since you can't add or subtract final-ness
632 <    // of a field in a subclass, they can't share represenations,
632 >    // of a field in a subclass, they can't share representations,
633      // and the amount of duplicated code is too small to warrant
634      // exposing a common abstract class.
635  
# Line 643 | Line 643 | public abstract class AbstractMap<K,V> i
643       * <tt>Map.entrySet().toArray</tt>
644       */
645      public static class SimpleEntry<K,V> implements Entry<K,V> {
646 <        private K key;
646 >        private final K key;
647          private V value;
648  
649          /**
# Line 664 | Line 664 | public abstract class AbstractMap<K,V> i
664           *
665           * @param entry the entry to copy.
666           */
667 <        public SimpleEntry(Entry<K,V> entry) {
667 >        public SimpleEntry(Entry<? extends K, ? extends V> entry) {
668              this.key   = entry.getKey();
669              this.value = entry.getValue();
670          }
# Line 692 | Line 692 | public abstract class AbstractMap<K,V> i
692           * value.
693           *
694           * @param value new value to be stored in this entry.
695 <         * @return old value corresponding to the entry.
695 >         * @return the old value corresponding to the entry.
696           */
697          public V setValue(V value) {
698              V oldValue = this.value;
# Line 754 | Line 754 | public abstract class AbstractMap<K,V> i
754           *
755           * @param entry the entry to copy.
756           */
757 <        public SimpleImmutableEntry(Entry<K,V> entry) {
757 >        public SimpleImmutableEntry(Entry<? extends K, ? extends V> entry) {
758              this.key   = entry.getKey();
759              this.value = entry.getValue();
760          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines