|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
water.nbhm.NonBlockingHashSet<E>
public class NonBlockingHashSet<E>
A simple wrapper around NonBlockingHashMap making it implement the
Set interface. All operations are Non-Blocking and multi-thread safe.
| Constructor Summary | |
|---|---|
NonBlockingHashSet()
Make a new empty NonBlockingHashSet. |
|
| Method Summary | |
|---|---|
boolean |
add(E o)
Add o to the set. |
E |
addIfAbsent(E o)
Add o to the set. |
void |
clear()
Empty the set. |
boolean |
contains(java.lang.Object o)
|
E |
get(E o)
|
java.util.Iterator<E> |
iterator()
|
void |
readOnly()
Atomically make the set immutable. |
boolean |
remove(java.lang.Object o)
Remove o from the set. |
int |
size()
Current count of elements in the set. |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, containsAll, isEmpty, 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, containsAll, isEmpty, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public NonBlockingHashSet()
NonBlockingHashSet.
| Method Detail |
|---|
public boolean add(E o)
o to the set.
add in interface java.util.Collection<E>add in interface java.util.Set<E>add in class java.util.AbstractCollection<E>o was added to the set, false
if o was already in the set.public E addIfAbsent(E o)
o to the set.
o if it was already in the set, or o otherwise.public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<E>contains in interface java.util.Set<E>contains in class java.util.AbstractCollection<E>o is in the set.public E get(E o)
o if o is in the set.public boolean remove(java.lang.Object o)
o from the set.
remove in interface java.util.Collection<E>remove in interface java.util.Set<E>remove in class java.util.AbstractCollection<E>o was removed to the set, false
if o was not in the set.public int size()
size in interface java.util.Collection<E>size in interface java.util.Set<E>size in class java.util.AbstractCollection<E>public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.Set<E>clear in class java.util.AbstractCollection<E>public java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>iterator in interface java.util.Set<E>iterator in class java.util.AbstractCollection<E>public void readOnly()
readOnly() call returns. This call can be called concurrently
(and indeed until the operation completes, all calls on the Set from any
thread either complete normally or end up calling readOnly()
internally).
This call is useful in debugging multi-threaded programs where the
Set is constructed in parallel, but construction completes after some
time; and after construction the Set is only read. Making the Set
read-only will cause updates arriving after construction is supposedly
complete to throw an IllegalStateException.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||