GigaSpaces XAP 9.0 API

com.sun.jini.collection
Class WeakSoftTable

java.lang.Object
  extended by com.sun.jini.collection.WeakSoftTable

public final class WeakSoftTable
extends Object

A table that maps a key containing a weak reference to one or more values containing soft references. The weakly-referenced object in a key are compared for identity using ==. Entries are removed when either weak references in keys or soft references in values are cleared. Callers must insure that instances of this class are not accessed concurrently while they are being modified.

Since:
2.0
Author:
Sun Microsystems, Inc.

Nested Class Summary
static interface WeakSoftTable.RemovableReference
          Implemented by classes to permit copying instances into reference queues when they are added to the table and to remove them from the table when the references are cleared.
static class WeakSoftTable.SoftValue
          A value that maintains a soft reference to an object.
static class WeakSoftTable.WeakKey
          A key that maintains a weak reference to an object which should be compared by object identity.
 
Constructor Summary
WeakSoftTable()
          Creates an instance of this class.
 
Method Summary
 void add(WeakSoftTable.WeakKey key, WeakSoftTable.SoftValue value)
          Associates an additional value with the specified key.
 WeakSoftTable.SoftValue get(WeakSoftTable.WeakKey key, int index)
          Returns the value associated with the specified key and index, or null if not found.
 WeakSoftTable.SoftValue remove(WeakSoftTable.WeakKey key, int index)
          Removes and returns the index'th value associated with the specified key.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WeakSoftTable

public WeakSoftTable()
Creates an instance of this class.

Method Detail

get

public WeakSoftTable.SoftValue get(WeakSoftTable.WeakKey key,
                                   int index)
Returns the value associated with the specified key and index, or null if not found. Values are stored in order, so if a given index is null, then values for higher index values will also be null.


add

public void add(WeakSoftTable.WeakKey key,
                WeakSoftTable.SoftValue value)
Associates an additional value with the specified key. The value is added at the next open index.


remove

public WeakSoftTable.SoftValue remove(WeakSoftTable.WeakKey key,
                                      int index)
Removes and returns the index'th value associated with the specified key. Returns null if the item is not found.


toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.