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() |
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 |
*/ |
*/ |
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) |
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 |
*/ |
*/ |