org.apache.ignite.internal.util

## Class GridConcurrentWeakHashSet<E>

- java.lang.Object
- - org.apache.ignite.internal.util.GridConcurrentWeakHashSet<E>

All Implemented Interfaces:
  Iterable<E>, Collection<E>, Set<E>

    public class GridConcurrentWeakHashSet<E>
    extends Object
    implements Set<E>

Concurrent weak hash set implementation.

### Constructor Summary

Constructors
Constructor and Description
`GridConcurrentWeakHashSet()` Creates a new, empty set with a default initial capacity, load factor, and concurrencyLevel.
`GridConcurrentWeakHashSet(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.
`GridConcurrentWeakHashSet(int initCap)` Creates a new, empty set with the specified initial capacity, and with default load factor and concurrencyLevel.
`GridConcurrentWeakHashSet(int initCap, float loadFactor, int conLevel)` Creates a new, empty set with the specified initial capacity, load factor, and concurrency level.

### Method Summary

All Methods Instance Methods Concrete Methods
`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`

### Methods inherited from interface java.util.Set

`spliterator`

### Methods inherited from interface java.util.Collection

`parallelStream, removeIf, stream`

### Methods inherited from interface java.lang.Iterable

`forEach`

### Constructor Detail

#### GridConcurrentWeakHashSet

    public GridConcurrentWeakHashSet()

Creates a new, empty set with a default initial capacity, load factor, and concurrencyLevel.

#### GridConcurrentWeakHashSet

    public GridConcurrentWeakHashSet(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.

#### GridConcurrentWeakHashSet

    public GridConcurrentWeakHashSet(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.

#### GridConcurrentWeakHashSet

    public GridConcurrentWeakHashSet(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`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018