net.spy.util
Class SoftHashSet<T>

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

public class SoftHashSet<T>
extends ReferenceSet<T>

Implementation of ReferenceSet that uses soft references.


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

Parameters:
c - the collection
Method Detail

getReference

protected Reference<T> getReference(T o)
Return a soft reference.

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


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