net.spy.util
Class SoftHashSet

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractSet
          extended bynet.spy.util.ReferenceSet
              extended bynet.spy.util.SoftHashSet
All Implemented Interfaces:
Collection, Set

public class SoftHashSet
extends ReferenceSet

Implementation of ReferenceSet that uses soft references.


Constructor Summary
SoftHashSet()
          Get an instance of SoftHashSet.
SoftHashSet(Collection c)
          Get a SoftHashSet with the contents from the given Collection.
SoftHashSet(int n)
          Create a SoftHashSet with the given capacity.
 
Method Summary
protected  Reference getReference(Object o)
          Return a soft reference.
 
Methods inherited from class net.spy.util.ReferenceSet
add, iterator, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray
 

Constructor Detail

SoftHashSet

public SoftHashSet()
Get an instance of SoftHashSet.


SoftHashSet

public SoftHashSet(int n)
Create a SoftHashSet with the given capacity.

Parameters:
n - the capacity

SoftHashSet

public SoftHashSet(Collection c)
Get a SoftHashSet with the contents from the given Collection.

Parameters:
c - the collection
Method Detail

getReference

protected Reference getReference(Object o)
Return a soft reference.

Specified by:
getReference in class ReferenceSet
Parameters:
o - an object
Returns:
a reference to that object