ecologylab.generic
Class HashSetWriteSynch<K>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<K>
              extended by ecologylab.generic.HashSetWriteSynch<K>
Type Parameters:
K -
V -
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<K>, java.util.Collection<K>, java.util.Set<K>

public class HashSetWriteSynch<K>
extends java.util.HashSet<K>

Hashed data structure with synchronized writes/deletes and unsynchronized reads.

Author:
andruid, robinson
See Also:
Serialized Form

Constructor Summary
HashSetWriteSynch()
           
HashSetWriteSynch(java.util.Collection<? extends K> collection)
           
HashSetWriteSynch(int arg0)
           
HashSetWriteSynch(int arg0, float arg1)
           
 
Method Summary
 boolean add(K key)
          Sycnhronizes add.
 boolean addAll(java.util.Collection<? extends K> c)
          Sycnhronizes if you add another set to this one.
 boolean remove(java.lang.Object key)
          Sycnhronizes remove.
 
Methods inherited from class java.util.HashSet
clear, clone, contains, isEmpty, iterator, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

HashSetWriteSynch

public HashSetWriteSynch(int arg0,
                         float arg1)

HashSetWriteSynch

public HashSetWriteSynch(int arg0)

HashSetWriteSynch

public HashSetWriteSynch()

HashSetWriteSynch

public HashSetWriteSynch(java.util.Collection<? extends K> collection)
Method Detail

add

public boolean add(K key)
Sycnhronizes add.

Specified by:
add in interface java.util.Collection<K>
Specified by:
add in interface java.util.Set<K>
Overrides:
add in class java.util.HashSet<K>

remove

public boolean remove(java.lang.Object key)
Sycnhronizes remove.

Specified by:
remove in interface java.util.Collection<K>
Specified by:
remove in interface java.util.Set<K>
Overrides:
remove in class java.util.HashSet<K>

addAll

public boolean addAll(java.util.Collection<? extends K> c)
Sycnhronizes if you add another set to this one.

Specified by:
addAll in interface java.util.Collection<K>
Specified by:
addAll in interface java.util.Set<K>
Overrides:
addAll in class java.util.AbstractCollection<K>