org.apache.ignite.internal.util

## Class GridConcurrentLinkedHashSet<E>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractSet<E>
    - - org.apache.ignite.internal.util.GridSerializableSet<E>
      - - org.apache.ignite.internal.util.GridSetWrapper<E>
        - - org.apache.ignite.internal.util.GridConcurrentLinkedHashSet<E>

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

    public class GridConcurrentLinkedHashSet<E>
    extends GridSetWrapper<E>

Concurrent linked set implementation.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.ignite.internal.util.GridSetWrapper

`map, VAL`

### Constructor Summary

Constructors
Constructor and Description
`GridConcurrentLinkedHashSet()` Creates a new, empty set with a default initial capacity, load factor, and concurrencyLevel.
`GridConcurrentLinkedHashSet(Collection<E> c)` Creates a new set with the same elements as the given collection.
`GridConcurrentLinkedHashSet(int initCap)` Creates a new, empty set with the specified initial capacity, and with default load factor and concurrencyLevel.
`GridConcurrentLinkedHashSet(int initCap, float loadFactor, int conLevel)` Creates a new, empty set with the specified initial capacity, load factor, and concurrency level.

### Method Summary

Methods
`boolean` `add(E e)` Note that unlike regular add operation on a set, this method will only add the passed in element if it's not already present in set.
`E` `addx(E e)` Note that unlike regular add operation on a set, this method will only add the passed in element if it's not already present in set.
`Iterator<E>` `descendingIterator()`
`String` `toString()`

### Methods inherited from class org.apache.ignite.internal.util.GridSetWrapper

`clear, contains, defaultValue, isEmpty, iterator, map, remove, size, toArray, toArray`

### Methods inherited from class java.util.AbstractSet

`equals, hashCode, removeAll`

### Methods inherited from class java.util.AbstractCollection

`addAll, containsAll, retainAll`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

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

`addAll, containsAll, retainAll`

### Constructor Detail

#### GridConcurrentLinkedHashSet

    public GridConcurrentLinkedHashSet()

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

#### GridConcurrentLinkedHashSet

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

#### GridConcurrentLinkedHashSet

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

#### GridConcurrentLinkedHashSet

    public GridConcurrentLinkedHashSet(Collection<E> c)

Creates a new set with the same elements as the given collection. The collection is created with a capacity of twice the number of mappings in the given map or 11 (whichever is greater), and a default load factor and concurrencyLevel.

Parameters:
  `c` - Collection to add.

### Method Detail

#### add

    public boolean add(E e)

Note that unlike regular add operation on a set, this method will only add the passed in element if it's not already present in set.

Specified by:
  `add` in interface `Collection<E>`
Specified by:
  `add` in interface `Set<E>`
Overrides:
  `add` in class `GridSetWrapper<E>`
Parameters:
  `e` - Element to add.
Returns:
  `True` if element was added.

#### addx

    @Nullable
    public E addx(E e)

Note that unlike regular add operation on a set, this method will only add the passed in element if it's not already present in set.

Parameters:
  `e` - Element to add.
Returns:
  Value previously present in set or `null` if set didn't have this value.

#### descendingIterator

    public Iterator<E> descendingIterator()

Returns:
  Descending iterator.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridSetWrapper<E>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.7.0
Release Date | : August 1 2016