GigaSpaces XAP 9.7.2 API

com.sun.jini.collection
Class WeakSoftTable.WeakKey

java.lang.Object
  extended by java.lang.ref.Reference<T>
      extended by java.lang.ref.WeakReference
          extended by com.sun.jini.collection.WeakSoftTable.WeakKey
All Implemented Interfaces:
WeakSoftTable.RemovableReference
Enclosing class:
WeakSoftTable

public static class WeakSoftTable.WeakKey
extends WeakReference
implements WeakSoftTable.RemovableReference

A key that maintains a weak reference to an object which should be compared by object identity.


Constructor Summary
  WeakSoftTable.WeakKey(Object key)
          Creates a key that holds a weak reference to the argument and compares it using ==.
protected WeakSoftTable.WeakKey(WeakSoftTable.WeakKey weakKey, ReferenceQueue queue)
          Creates a copy of the key registered with the queue.
 
Method Summary
 void cleared(Map map)
          Called with the containing map when this instance's reference is cleared, to remove the associated entry from the map.
 WeakSoftTable.RemovableReference copy(ReferenceQueue queue)
          Returns a copy of this instance registered with the specified queue.
 boolean equals(Object o)
          Returns true if the argument is an instance of the same concrete class, and if both objects had null keys, or if neither object has had its weak key cleared and their values are ==.
 int hashCode()
           
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, get, isEnqueued
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakSoftTable.WeakKey

public WeakSoftTable.WeakKey(Object key)
Creates a key that holds a weak reference to the argument and compares it using ==.


WeakSoftTable.WeakKey

protected WeakSoftTable.WeakKey(WeakSoftTable.WeakKey weakKey,
                                ReferenceQueue queue)
Creates a copy of the key registered with the queue.

Method Detail

copy

public WeakSoftTable.RemovableReference copy(ReferenceQueue queue)
Description copied from interface: WeakSoftTable.RemovableReference
Returns a copy of this instance registered with the specified queue.

Specified by:
copy in interface WeakSoftTable.RemovableReference
Parameters:
queue - the queue with which this instance should be registered
Returns:
the copy

cleared

public void cleared(Map map)
Description copied from interface: WeakSoftTable.RemovableReference
Called with the containing map when this instance's reference is cleared, to remove the associated entry from the map.

Specified by:
cleared in interface WeakSoftTable.RemovableReference
Parameters:
map - the map from which this newly cleared instance should be removed

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Returns true if the argument is an instance of the same concrete class, and if both objects had null keys, or if neither object has had its weak key cleared and their values are ==.

Overrides:
equals in class Object

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.