Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.util
Class IdentityHashMap.IdentityEntry  view IdentityHashMap.IdentityEntry download IdentityHashMap.IdentityEntry.java

java.lang.Object
  extended byjava.util.IdentityHashMap.IdentityEntry
All Implemented Interfaces:
Map.Entry
Enclosing class:
IdentityHashMap

private final class IdentityHashMap.IdentityEntry
extends java.lang.Object
implements Map.Entry

This class provides Map.Entry objects for IdentityHashMaps. The entry is fail-fast, and will throw a ConcurrentModificationException if the underlying map is modified, or if remove is called on the iterator that generated this object. It is identity based, so it violates the general contract of Map.Entry, and is probably unsuitable for comparison to normal maps; but it works among other IdentityHashMaps.


Field Summary
(package private)  int knownMod
          The number of modifications to the backing Map that we know about.
(package private)  int loc
          The location of this entry.
 
Constructor Summary
(package private) IdentityHashMap.IdentityEntry(int loc)
          Constructs the Entry.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object with this entry, using identity semantics.
 java.lang.Object getKey()
          Returns the key of this entry.
 java.lang.Object getValue()
          Returns the value of this entry.
 int hashCode()
          Returns the hashcode of the entry, using identity semantics.
 java.lang.Object setValue(java.lang.Object value)
          Replaces the value of this mapping, and returns the old value.
 java.lang.String toString()
          This provides a string representation of the entry.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

loc

final int loc
The location of this entry.


knownMod

final int knownMod
The number of modifications to the backing Map that we know about.

Constructor Detail

IdentityHashMap.IdentityEntry

IdentityHashMap.IdentityEntry(int loc)
Constructs the Entry.

Method Detail

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this entry, using identity semantics. Note that this can lead to undefined results with Entry objects created by normal maps.

Specified by:
equals in interface Map.Entry

getKey

public java.lang.Object getKey()
Returns the key of this entry.

Specified by:
getKey in interface Map.Entry

getValue

public java.lang.Object getValue()
Returns the value of this entry.

Specified by:
getValue in interface Map.Entry

hashCode

public int hashCode()
Returns the hashcode of the entry, using identity semantics. Note that this can lead to undefined results with Entry objects created by normal maps.

Specified by:
hashCode in interface Map.Entry

setValue

public java.lang.Object setValue(java.lang.Object value)
Replaces the value of this mapping, and returns the old value.

Specified by:
setValue in interface Map.Entry

toString

public java.lang.String toString()
This provides a string representation of the entry. It is of the form "key=value", where string concatenation is used on key and value.