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

Diff of /classpath/java/util/AbstractMap.java

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

revision 1.16 by ericb, Fri Oct 19 00:17:44 2001 UTC revision 1.17 by ericb, Fri Oct 19 07:06:45 2001 UTC
# Line 218  public abstract class AbstractMap implem Line 218  public abstract class AbstractMap implem
218    
219    /**    /**
220     * Returns the hash code for this map. As defined in Map, this is the sum     * Returns the hash code for this map. As defined in Map, this is the sum
221     * of all hashcodes for each Map.Entry object in entrySet.     * of all hashcodes for each Map.Entry object in entrySet, or basically
222       * entrySet().hashCode().
223     *     *
224     * @return the hash code     * @return the hash code
225     * @see Map.Entry#hashCode()     * @see Map.Entry#hashCode()
# Line 226  public abstract class AbstractMap implem Line 227  public abstract class AbstractMap implem
227     */     */
228    public int hashCode()    public int hashCode()
229    {    {
230      int hashcode = 0;      return entrySet().hashCode();
     Iterator itr = entrySet().iterator();  
     int pos = size();  
     while (--pos >= 0)  
       hashcode += itr.next().hashCode();  
     return hashcode;  
231    }    }
232    
233    /**    /**

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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