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.9 by jsr166, Sat May 14 01:52:24 2005 UTC vs.
Revision 1.12 by jsr166, Fri Jun 10 16:06:46 2005 UTC

# Line 85 | Line 85 | public abstract class AbstractMap<K,V> i
85       * finding such an entry, <tt>false</tt> is returned.  Note that this
86       * implementation requires linear time in the size of the map.
87       *
88     * @throws NullPointerException {@inheritDoc}
88       * @throws ClassCastException   {@inheritDoc}
89 +     * @throws NullPointerException {@inheritDoc}
90       */
91      public boolean containsValue(Object value) {
92          Iterator<Entry<K,V>> i = entrySet().iterator();
# Line 116 | Line 116 | public abstract class AbstractMap<K,V> i
116       * implementation requires linear time in the size of the map; many
117       * implementations will override this method.
118       *
119     * @throws NullPointerException {@inheritDoc}
119       * @throws ClassCastException   {@inheritDoc}
120 +     * @throws NullPointerException {@inheritDoc}
121       */
122      public boolean containsKey(Object key) {
123          Iterator<Map.Entry<K,V>> i = entrySet().iterator();
# Line 147 | Line 147 | public abstract class AbstractMap<K,V> i
147       * implementation requires linear time in the size of the map; many
148       * implementations will override this method.
149       *
150     * @throws NullPointerException          {@inheritDoc}
150       * @throws ClassCastException            {@inheritDoc}
151 +     * @throws NullPointerException          {@inheritDoc}
152       */
153      public V get(Object key) {
154          Iterator<Entry<K,V>> i = entrySet().iterator();
# Line 178 | Line 178 | public abstract class AbstractMap<K,V> i
178       * <tt>UnsupportedOperationException</tt>.
179       *
180       * @throws UnsupportedOperationException {@inheritDoc}
181     * @throws NullPointerException          {@inheritDoc}
181       * @throws ClassCastException            {@inheritDoc}
182 +     * @throws NullPointerException          {@inheritDoc}
183       * @throws IllegalArgumentException      {@inheritDoc}
184       */
185      public V put(K key, V value) {
# Line 204 | Line 204 | public abstract class AbstractMap<K,V> i
204       * contains a mapping for the specified key.
205       *
206       * @throws UnsupportedOperationException {@inheritDoc}
207     * @throws NullPointerException          {@inheritDoc}
207       * @throws ClassCastException            {@inheritDoc}
208 +     * @throws NullPointerException          {@inheritDoc}
209       */
210      public V remove(Object key) {
211          Iterator<Entry<K,V>> i = entrySet().iterator();
# Line 247 | Line 247 | public abstract class AbstractMap<K,V> i
247       * the <tt>put</tt> operation and the specified map is nonempty.
248       *
249       * @throws UnsupportedOperationException {@inheritDoc}
250     * @throws NullPointerException          {@inheritDoc}
250       * @throws ClassCastException            {@inheritDoc}
251 +     * @throws NullPointerException          {@inheritDoc}
252       * @throws IllegalArgumentException      {@inheritDoc}
253       */
254      public void putAll(Map<? extends K, ? extends V> m) {
# Line 468 | Line 468 | public abstract class AbstractMap<K,V> i
468       * appended.  Finally a right brace is appended.  A string is obtained
469       * from the stringbuffer, and returned.
470       *
471 <     * @return a String representation of this map.
471 >     * @return a String representation of this map
472       */
473      public String toString() {
474 <        StringBuffer buf = new StringBuffer();
475 <        buf.append("{");
474 >        StringBuilder sb = new StringBuilder();
475 >        sb.append("{");
476  
477          Iterator<Entry<K,V>> i = entrySet().iterator();
478          boolean hasNext = i.hasNext();
# Line 481 | Line 481 | public abstract class AbstractMap<K,V> i
481              K key = e.getKey();
482              V value = e.getValue();
483              if (key == this)
484 <                buf.append("(this Map)");
484 >                sb.append("(this Map)");
485              else
486 <                buf.append(key);
487 <            buf.append("=");
486 >                sb.append(key);
487 >            sb.append("=");
488              if (value == this)
489 <                buf.append("(this Map)");
489 >                sb.append("(this Map)");
490              else
491 <                buf.append(value);
491 >                sb.append(value);
492              hasNext = i.hasNext();
493              if (hasNext)
494 <                buf.append(", ");
494 >                sb.append(", ");
495          }
496  
497 <        buf.append("}");
498 <        return buf.toString();
497 >        sb.append("}");
498 >        return sb.toString();
499      }
500  
501      /**
# Line 555 | Line 555 | public abstract class AbstractMap<K,V> i
555           * Creates an entry representing the same mapping as the
556           * specified entry.
557           *
558 <         * @param entry the entry to copy.
558 >         * @param entry the entry to copy
559           */
560          public SimpleEntry(Entry<? extends K, ? extends V> entry) {
561              this.key   = entry.getKey();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines