Package org.openspaces.core.util
Class ConcurrentHashSet<E>
java.lang.Object
org.openspaces.core.util.ConcurrentHashSet<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>
- Author:
- kimchy
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.75). -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the specified element to this set if it is not already present.booleanaddAll(Collection<? extends E> c) voidclear()Removes all of the elements from this set.booleanReturns true if this set contains the specified element.booleancontainsAll(Collection<?> c) booleanisEmpty()Returns true if this set contains no elements.iterator()Returns an iterator over the elements in this set.booleanRemoves the specified element from this set if it is present.booleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Returns the number of elements in this set (its cardinality).Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
ConcurrentHashSet
public ConcurrentHashSet()Constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.75).
-
-
Method Details
-
iterator
Returns an iterator over the elements in this set. The elements are returned in no particular order. -
size
public int size()Returns the number of elements in this set (its cardinality). -
isEmpty
public boolean isEmpty()Returns true if this set contains no elements. -
contains
Returns true if this set contains the specified element. -
add
Adds the specified element to this set if it is not already present. -
remove
Removes the specified element from this set if it is present. -
clear
public void clear()Removes all of the elements from this set. -
addAll
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
removeAll
-
retainAll
-
toArray
-
toArray
public <T> T[] toArray(T[] a)
-