Package org.apache.ignite.internal.util
Class GridConcurrentPhantomHashSet<E>
- java.lang.Object
-
- org.apache.ignite.internal.util.GridConcurrentPhantomHashSet<E>
-
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>
public class GridConcurrentPhantomHashSet<E> extends Object implements Set<E>
Concurrent phantom hash set implementation.
-
-
Constructor Summary
Constructors Constructor Description GridConcurrentPhantomHashSet()Creates a new, empty set with a default initial capacity, load factor, and concurrencyLevel.GridConcurrentPhantomHashSet(int initCap)Creates a new, empty set with the specified initial capacity, and with default load factor and concurrencyLevel.GridConcurrentPhantomHashSet(int initCap, float loadFactor, int conLevel)Creates a new, empty set with the specified initial capacity, load factor, and concurrency level.GridConcurrentPhantomHashSet(Collection<E> c)Constructs a new set containing the elements in the specified collection, with default load factor and an initial capacity sufficient to contain the elements in the specified collection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(@Nullable Collection<? extends E> c)voidclear()booleancontains(@Nullable Object o)booleancontainsAll(@Nullable Collection<?> c)booleanequals(@Nullable Object o)inthashCode()booleanisEmpty()Iterator<E>iterator()protected voidonGc(E e)This method is called on every element when it gets GC-ed.booleanremove(@Nullable Object o)booleanremoveAll(@Nullable Collection<?> c)booleanretainAll(@Nullable Collection<?> c)intsize()Object[]toArray()<T> T[]toArray(T[] a)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
spliterator
-
-
-
-
Constructor Detail
-
GridConcurrentPhantomHashSet
public GridConcurrentPhantomHashSet()
Creates a new, empty set with a default initial capacity, load factor, and concurrencyLevel.
-
GridConcurrentPhantomHashSet
public GridConcurrentPhantomHashSet(int initCap)
Creates a new, empty set with the specified initial capacity, and with default load factor and concurrencyLevel.- Parameters:
initCap- The initial capacity. The implementation performs internal sizing to accommodate this many elements.- Throws:
IllegalArgumentException- if the initial capacity of elements is negative.
-
GridConcurrentPhantomHashSet
public GridConcurrentPhantomHashSet(int initCap, float loadFactor, int conLevel)Creates a new, empty set with the specified initial capacity, load factor, and concurrency level.- Parameters:
initCap- The initial capacity. The implementation performs internal sizing to accommodate this many elements.loadFactor- The load factor threshold, used to control resizing. Resizing may be performed when the average number of elements per bin exceeds this threshold.conLevel- The estimated number of concurrently updating threads. The implementation performs internal sizing to try to accommodate this many threads.- Throws:
IllegalArgumentException- if the initial capacity is negative or the load factor or concurrency level are non-positive.
-
GridConcurrentPhantomHashSet
public GridConcurrentPhantomHashSet(Collection<E> c)
Constructs a new set containing the elements in the specified collection, with default load factor and an initial capacity sufficient to contain the elements in the specified collection.- Parameters:
c- Collection to add.
-
-
Method Detail
-
add
public boolean add(E e)
-
addAll
public boolean addAll(@Nullable @Nullable Collection<? extends E> c)
-
retainAll
public boolean retainAll(@Nullable @Nullable Collection<?> c)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(@Nullable @Nullable Object o)
-
containsAll
public boolean containsAll(@Nullable @Nullable Collection<?> c)- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
clear
public void clear()
-
remove
public boolean remove(@Nullable @Nullable Object o)
-
removeAll
public boolean removeAll(@Nullable @Nullable Collection<?> c)
-
equals
public boolean equals(@Nullable @Nullable Object o)
-
hashCode
public int hashCode()
-
onGc
protected void onGc(E e)
This method is called on every element when it gets GC-ed.- Parameters:
e- Element that is about to get GC-ed.
-
-