net.spy.util
Class SoftHashSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet
          extended by net.spy.util.ReferenceSet
              extended by net.spy.util.SoftHashSet
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.Set

public class SoftHashSet
extends ReferenceSet

Implementation of ReferenceSet that uses soft references.


Constructor Summary
SoftHashSet()
          Get an instance of SoftHashSet.
SoftHashSet(java.util.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  java.lang.ref.Reference getReference(java.lang.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(java.util.Collection c)
Get a SoftHashSet with the contents from the given Collection.

Parameters:
c - the collection
Method Detail

getReference

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

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


Copyright © 1995-2005 SPY Internetworking. All Rights Reserved.