/[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.25 by brawer, Tue Apr 30 14:00:32 2002 UTC revision 1.26 by ericb, Wed Nov 6 14:03:43 2002 UTC
# Line 466  public abstract class AbstractMap implem Line 466  public abstract class AbstractMap implem
466            return AbstractMap.this.size();            return AbstractMap.this.size();
467          }          }
468    
469            public boolean contains(Object value)
470            {
471              return containsValue(value);
472            }
473    
474          public Iterator iterator()          public Iterator iterator()
475          {          {
476            return new Iterator()            return new Iterator()
# Line 527  public abstract class AbstractMap implem Line 532  public abstract class AbstractMap implem
532     * @author Jon Zeppieri     * @author Jon Zeppieri
533     * @author Eric Blake <ebb9@email.byu.edu>     * @author Eric Blake <ebb9@email.byu.edu>
534     */     */
535      // XXX - FIXME Use fully qualified implements as gcj 3.1 workaround.
536    static class BasicMapEntry implements Map.Entry    static class BasicMapEntry implements Map.Entry
537    {     // XXX - FIXME Use fully qualified implements as gcj 3.1 workaround.    {
538      /**      /**
539       * The key. Package visible for direct manipulation.       * The key. Package visible for direct manipulation.
540       */       */
# Line 553  public abstract class AbstractMap implem Line 559  public abstract class AbstractMap implem
559      /**      /**
560       * Compares the specified object with this entry. Returns true only if       * Compares the specified object with this entry. Returns true only if
561       * the object is a mapping of identical key and value. In other words,       * the object is a mapping of identical key and value. In other words,
562       * this must be:       * this must be:<br>
563       *       * <pre>(o instanceof Map.Entry)
564  <pre>(o instanceof Map.Entry) &&       *       && (getKey() == null ? ((HashMap) o).getKey() == null
565  (getKey() == null ? ((HashMap) o).getKey() == null       *           : getKey().equals(((HashMap) o).getKey()))
566                    : getKey().equals(((HashMap) o).getKey())) &&       *       && (getValue() == null ? ((HashMap) o).getValue() == null
567  (getValue() == null ? ((HashMap) o).getValue() == null       *           : getValue().equals(((HashMap) o).getValue()))</pre>
                     : getValue().equals(((HashMap) o).getValue()))</pre>  
568       *       *
569       * @param o the object to compare       * @param o the object to compare
      *  
570       * @return <code>true</code> if it is equal       * @return <code>true</code> if it is equal
571       */       */
572      public final boolean equals(Object o)      public final boolean equals(Object o)
# Line 605  public abstract class AbstractMap implem Line 609  public abstract class AbstractMap implem
609      /**      /**
610       * Returns the hash code of the entry.  This is defined as the exclusive-or       * Returns the hash code of the entry.  This is defined as the exclusive-or
611       * of the hashcodes of the key and value (using 0 for null). In other       * of the hashcodes of the key and value (using 0 for null). In other
612       * words, this must be:       * words, this must be:<br>
613       *       * <pre>(getKey() == null ? 0 : getKey().hashCode())
614  <pre>(getKey() == null ? 0 : getKey().hashCode())       *       ^ (getValue() == null ? 0 : getValue().hashCode())</pre>
 ^ (getValue() == null ? 0 : getValue().hashCode())</pre>  
615       *       *
616       * @return the hash code       * @return the hash code
617       */       */

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

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