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

Quick Search    Search Deep

java.util
Class WeakHashMap.WeakBucket.WeakEntry  view WeakHashMap.WeakBucket.WeakEntry download WeakHashMap.WeakBucket.WeakEntry.java

java.lang.Object
  extended byjava.util.WeakHashMap.WeakBucket.WeakEntry
All Implemented Interfaces:
Map.Entry
Enclosing class:
WeakHashMap.WeakBucket

class WeakHashMap.WeakBucket.WeakEntry
extends java.lang.Object
implements Map.Entry

This class gives the Entry representation of the current bucket. It also keeps a strong reference to the key; bad things may happen otherwise.


Field Summary
(package private)  java.lang.Object key
          The strong ref to the key.
 
Constructor Summary
WeakHashMap.WeakBucket.WeakEntry(java.lang.Object key)
          Creates a new entry for the key.
 
Method Summary
 boolean equals(java.lang.Object o)
          The equals method as specified in the Entry interface.
 WeakHashMap.WeakBucket getBucket()
          Returns the underlying bucket.
 java.lang.Object getKey()
          Returns the key.
 java.lang.Object getValue()
          Returns the value.
 int hashCode()
          The hashCode as specified in the Entry interface.
 java.lang.Object setValue(java.lang.Object newVal)
          This changes the value.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

key

java.lang.Object key
The strong ref to the key.

Constructor Detail

WeakHashMap.WeakBucket.WeakEntry

public WeakHashMap.WeakBucket.WeakEntry(java.lang.Object key)
Creates a new entry for the key.

Method Detail

getBucket

public WeakHashMap.WeakBucket getBucket()
Returns the underlying bucket.


getKey

public java.lang.Object getKey()
Returns the key.

Specified by:
getKey in interface Map.Entry

getValue

public java.lang.Object getValue()
Returns the value.

Specified by:
getValue in interface Map.Entry

setValue

public java.lang.Object setValue(java.lang.Object newVal)
This changes the value. This change takes place in the underlying hash map.

Specified by:
setValue in interface Map.Entry

hashCode

public int hashCode()
The hashCode as specified in the Entry interface.

Specified by:
hashCode in interface Map.Entry

equals

public boolean equals(java.lang.Object o)
The equals method as specified in the Entry interface.

Specified by:
equals in interface Map.Entry

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).