/[classpath]/classpath/java/util/Map.java
ViewVC logotype

Diff of /classpath/java/util/Map.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by brawer, Tue Apr 30 22:05:37 2002 UTC revision 1.11 by mkoch, Wed Oct 15 12:29:35 2003 UTC
# Line 85  public interface Map Line 85  public interface Map
85     *     *
86     * @throws UnsupportedOperationException if clear is not supported     * @throws UnsupportedOperationException if clear is not supported
87     */     */
88    public void clear();    void clear();
89    
90    /**    /**
91     * Returns true if this contains a mapping for the given key.     * Returns true if this contains a mapping for the given key.
# Line 96  public interface Map Line 96  public interface Map
96     * @throws NullPointerException if key is <code>null</code> but the map     * @throws NullPointerException if key is <code>null</code> but the map
97     *         does not permit null keys     *         does not permit null keys
98     */     */
99    public boolean containsKey(Object key);    boolean containsKey(Object key);
100    
101    /**    /**
102     * Returns true if this contains at least one mapping with the given value.     * Returns true if this contains at least one mapping with the given value.
# Line 107  public interface Map Line 107  public interface Map
107     * @param value the value to search for     * @param value the value to search for
108     * @return true if the map contains the value     * @return true if the map contains the value
109     */     */
110    public boolean containsValue(Object value);    boolean containsValue(Object value);
111    
112    /**    /**
113     * Returns a set view of the mappings in this Map.  Each element in the     * Returns a set view of the mappings in this Map.  Each element in the
# Line 123  public interface Map Line 123  public interface Map
123     * @return the set view of all mapping entries     * @return the set view of all mapping entries
124     * @see Map.Entry     * @see Map.Entry
125     */     */
126    public Set entrySet();    Set entrySet();
127    
128    /**    /**
129     * Compares the specified object with this map for equality. Returns     * Compares the specified object with this map for equality. Returns
# Line 136  public interface Map Line 136  public interface Map
136     * @return true if the object equals this map     * @return true if the object equals this map
137     * @see Set#equals(Object)     * @see Set#equals(Object)
138     */     */
139    public boolean equals(Object o);    boolean equals(Object o);
140    
141    /**    /**
142     * Returns the value mapped by the given key. Returns <code>null</code> if     * Returns the value mapped by the given key. Returns <code>null</code> if
# Line 149  public interface Map Line 149  public interface Map
149     * @throws NullPointerException if this map does not accept null keys     * @throws NullPointerException if this map does not accept null keys
150     * @see #containsKey(Object)     * @see #containsKey(Object)
151     */     */
152    public Object get(Object key);    Object get(Object key);
153    
154    /**    /**
155     * Associates the given key to the given value (optional operation). If the     * Associates the given key to the given value (optional operation). If the
# Line 167  public interface Map Line 167  public interface Map
167     * @throws NullPointerException if the map forbids null keys or values     * @throws NullPointerException if the map forbids null keys or values
168     * @see #containsKey(Object)     * @see #containsKey(Object)
169     */     */
170    public Object put(Object key, Object value);    Object put(Object key, Object value);
171    
172    /**    /**
173     * Returns the hash code for this map. This is the sum of all hashcodes     * Returns the hash code for this map. This is the sum of all hashcodes
# Line 178  public interface Map Line 178  public interface Map
178     * @return the hash code     * @return the hash code
179     * @see Map.Entry#hashCode()     * @see Map.Entry#hashCode()
180     */     */
181    public int hashCode();    int hashCode();
182    
183    /**    /**
184     * Returns true if the map contains no mappings.     * Returns true if the map contains no mappings.
185     *     *
186     * @return true if the map is empty     * @return true if the map is empty
187     */     */
188    public boolean isEmpty();    boolean isEmpty();
189    
190    /**    /**
191     * Returns a set view of the keys in this Map.  The set is backed by the     * Returns a set view of the keys in this Map.  The set is backed by the
# Line 199  public interface Map Line 199  public interface Map
199     *     *
200     * @return the set view of all keys     * @return the set view of all keys
201     */     */
202    public Set keySet();    Set keySet();
203    
204    /**    /**
205     * Copies all entries of the given map to this one (optional operation). If     * Copies all entries of the given map to this one (optional operation). If
# Line 214  public interface Map Line 214  public interface Map
214     *         if <code>m</code> is null.     *         if <code>m</code> is null.
215     * @see #put(Object, Object)     * @see #put(Object, Object)
216     */     */
217    public void putAll(Map m);    void putAll(Map m);
218    
219    /**    /**
220     * Removes the mapping for this key if present (optional operation). If     * Removes the mapping for this key if present (optional operation). If
# Line 225  public interface Map Line 225  public interface Map
225     * @return the value the key mapped to, or null if not present     * @return the value the key mapped to, or null if not present
226     * @throws UnsupportedOperationException if deletion is unsupported     * @throws UnsupportedOperationException if deletion is unsupported
227     */     */
228    public Object remove(Object o);    Object remove(Object o);
229    
230    /**    /**
231     * Returns the number of key-value mappings in the map. If there are more     * Returns the number of key-value mappings in the map. If there are more
# Line 233  public interface Map Line 233  public interface Map
233     *     *
234     * @return the number of mappings     * @return the number of mappings
235     */     */
236    public int size();    int size();
237    
238    /**    /**
239     * Returns a collection (or bag) view of the values in this Map.  The     * Returns a collection (or bag) view of the values in this Map.  The
# Line 248  public interface Map Line 248  public interface Map
248     *     *
249     * @return the collection view of all values     * @return the collection view of all values
250     */     */
251    public Collection values();    Collection values();
252    
253    /**    /**
254     * A map entry (key-value pair). The Map.entrySet() method returns a set     * A map entry (key-value pair). The Map.entrySet() method returns a set
# Line 264  public interface Map Line 264  public interface Map
264     * @since 1.2     * @since 1.2
265     * @status updated to 1.4     * @status updated to 1.4
266     */     */
267    public static interface Entry    static interface Entry
268    {    {
269      /**      /**
270       * Get the key corresponding to this entry.       * Get the key corresponding to this entry.
271       *       *
272       * @return the key       * @return the key
273       */       */
274      public Object getKey();      Object getKey();
275    
276      /**      /**
277       * Get the value corresponding to this entry. If you already called       * Get the value corresponding to this entry. If you already called
# Line 279  public interface Map Line 279  public interface Map
279       *       *
280       * @return the value       * @return the value
281       */       */
282      public Object getValue();      Object getValue();
283    
284      /**      /**
285       * Replaces the value with the specified object (optional operation).       * Replaces the value with the specified object (optional operation).
# Line 294  public interface Map Line 294  public interface Map
294       *         prevents it from existing in this map       *         prevents it from existing in this map
295       * @throws NullPointerException if the map forbids null values       * @throws NullPointerException if the map forbids null values
296       */       */
297      public Object setValue(Object value);      Object setValue(Object value);
298    
299    
300      /**      /**
# Line 307  public interface Map Line 307  public interface Map
307       *       *
308       * @return the hash code       * @return the hash code
309       */       */
310      public int hashCode();      int hashCode();
311    
312      /**      /**
313       * Compares the specified object with this entry. Returns true only if       * Compares the specified object with this entry. Returns true only if
# Line 324  public interface Map Line 324  public interface Map
324       *       *
325       * @return <code>true</code> if it is equal       * @return <code>true</code> if it is equal
326       */       */
327      public boolean equals(Object o);      boolean equals(Object o);
328    }    }
329  }  }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26