public class NonBlockingHashSetLong extends AbstractSet<Long> implements Serializable
NonBlockingHashMapLong making it implement the
Set interface. All operations are Non-Blocking and multi-thread safe.| Constructor and Description |
|---|
NonBlockingHashSetLong()
Make a new empty
NonBlockingHashSetLong. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(long o)
Add
o to the set. |
boolean |
add(Long o)
To support AbstractCollection.addAll
|
boolean |
addAll(Collection<? extends Long> c) |
void |
clear()
Empty the set.
|
boolean |
contains(long o) |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
int |
hashCode() |
Iterator<Long> |
iterator() |
LongIterator |
longIterator() |
void |
readOnly()
Atomically make the set immutable.
|
boolean |
remove(long o)
Remove
o from the set. |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size()
Current count of elements in the set.
|
String |
toString() |
equalsisEmpty, toArray, toArraypublic NonBlockingHashSetLong()
NonBlockingHashSetLong.public boolean addAll(Collection<? extends Long> c)
addAll in interface Collection<Long>addAll in interface Set<Long>addAll in class AbstractCollection<Long>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<Long>removeAll in interface Set<Long>removeAll in class AbstractSet<Long>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<Long>containsAll in interface Set<Long>containsAll in class AbstractCollection<Long>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<Long>retainAll in interface Set<Long>retainAll in class AbstractCollection<Long>public int hashCode()
hashCode in interface Collection<Long>hashCode in interface Set<Long>hashCode in class AbstractSet<Long>public boolean add(long o)
o to the set.o was added to the set, false
if o was already in the set.public boolean add(Long o)
add in interface Collection<Long>add in interface Set<Long>add in class AbstractCollection<Long>public boolean contains(long o)
o is in the set.public boolean contains(Object o)
contains in interface Collection<Long>contains in interface Set<Long>contains in class AbstractCollection<Long>public boolean remove(long o)
o from the set.o was removed to the set, false
if o was not in the set.public boolean remove(Object o)
remove in interface Collection<Long>remove in interface Set<Long>remove in class AbstractCollection<Long>public int size()
size in interface Collection<Long>size in interface Set<Long>size in class AbstractCollection<Long>public void clear()
clear in interface Collection<Long>clear in interface Set<Long>clear in class AbstractCollection<Long>public String toString()
toString in class AbstractCollection<Long>public LongIterator longIterator()
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.
Copyright © 2015. All rights reserved.