GridGain™ 4.3.1e
Enterprise "Big Data" Edition

org.gridgain.grid.lang.utils
Class GridConcurrentPhantomHashSet<E>

java.lang.Object
  extended by org.gridgain.grid.lang.utils.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
GridConcurrentPhantomHashSet()
          Creates a new, empty set with a default initial capacity, load factor, and concurrencyLevel.
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.
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.
 
Method Summary
 boolean add(E e)
          
 boolean addAll(Collection<? extends E> c)
          
 void clear()
          
 boolean contains(Object o)
          
 boolean containsAll(Collection<?> c)
          
 boolean equals(Object o)
          
 int hashCode()
          
 boolean isEmpty()
          
 Iterator<E> iterator()
          
protected  void onGc(E e)
          This method is called on every element when it gets GC-ed.
 boolean remove(Object o)
          
 boolean removeAll(Collection<?> c)
          
 boolean retainAll(Collection<?> c)
          
 int size()
          
 Object[] toArray()
          
<T> T[]
toArray(T[] a)
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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.

Throws:
IllegalArgumentException - if the initial capacity of elements is negative.
Parameters:
initCap - The initial capacity. The implementation performs internal sizing to accommodate this many elements.

GridConcurrentPhantomHashSet

public GridConcurrentPhantomHashSet(int initCap,
                                    float loadFactor,
                                    int conLevel)
Creates a new, empty set with the specified initial capacity, load factor, and concurrency level.

Throws:
IllegalArgumentException - if the initial capacity is negative or the load factor or concurrency level are non-positive.
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.

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)

Specified by:
add in interface Collection<E>
Specified by:
add in interface Set<E>

addAll

public boolean addAll(@Nullable
                      Collection<? extends E> c)

Specified by:
addAll in interface Collection<E>
Specified by:
addAll in interface Set<E>

retainAll

public boolean retainAll(@Nullable
                         Collection<?> c)

Specified by:
retainAll in interface Collection<E>
Specified by:
retainAll in interface Set<E>

size

public int size()

Specified by:
size in interface Collection<E>
Specified by:
size in interface Set<E>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface Collection<E>
Specified by:
isEmpty in interface Set<E>

contains

public boolean contains(@Nullable
                        Object o)

Specified by:
contains in interface Collection<E>
Specified by:
contains in interface Set<E>

containsAll

public boolean containsAll(@Nullable
                           Collection<?> c)

Specified by:
containsAll in interface Collection<E>
Specified by:
containsAll in interface Set<E>

toArray

public Object[] toArray()

Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface Set<E>

toArray

public <T> T[] toArray(T[] a)

Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface Set<E>

iterator

public Iterator<E> iterator()

Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface Set<E>

clear

public void clear()

Specified by:
clear in interface Collection<E>
Specified by:
clear in interface Set<E>

remove

public boolean remove(@Nullable
                      Object o)

Specified by:
remove in interface Collection<E>
Specified by:
remove in interface Set<E>

removeAll

public boolean removeAll(@Nullable
                         Collection<?> c)

Specified by:
removeAll in interface Collection<E>
Specified by:
removeAll in interface Set<E>

equals

public boolean equals(@Nullable
                      Object o)

Specified by:
equals in interface Collection<E>
Specified by:
equals in interface Set<E>
Overrides:
equals in class Object

hashCode

public int hashCode()

Specified by:
hashCode in interface Collection<E>
Specified by:
hashCode in interface Set<E>
Overrides:
hashCode in class Object

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.

toString

public String toString()

Overrides:
toString in class Object

GridGain™ 4.3.1e
Enterprise "Big Data" Edition

GridGain - In-Memory Big Data
Enterprise "Big Data" Edition, ver. 4.3.1e.10112012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Join GridGain User Group Follow GridGain on Twitter Follow GridGain on Vimeo