org.apache.ignite.internal.util

## Class GridConcurrentSkipListSet<E>

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

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

Direct Known Subclasses:
  GridBoundedConcurrentOrderedSet

    public class GridConcurrentSkipListSet<E>
    extends GridSerializableSet<E>
    implements NavigableSet<E>, Cloneable

This class provided the same logic as `ConcurrentSkipListSet`. It adds methods `firstx()` and `lastx()`, which unlike `first()` and `last()` methods return `null` for empty sets instead of throwing `NoSuchElementException`.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridConcurrentSkipListSet()` Constructs a new, empty set that orders its elements according to their natural ordering.
`GridConcurrentSkipListSet(Collection<? extends E> c)` Constructs a new set containing the elements in the specified collection, that orders its elements according to their natural ordering.
`GridConcurrentSkipListSet(Comparator<? super E> comp)` Constructs a new, empty set that orders its elements according to the specified comparator.
`GridConcurrentSkipListSet(SortedSet<E> s)` Constructs a new set containing the same elements and using the same ordering as the specified sorted set.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `add(E e)`
`E` `ceiling(E e)`
`void` `clear()`
`GridConcurrentSkipListSet<E>` `clone()`
`Comparator<? super E>` `comparator()`
`boolean` `contains(Object o)`
`Iterator<E>` `descendingIterator()`
`NavigableSet<E>` `descendingSet()`
`boolean` `equals(Object o)`
`E` `first()`
`E` `firstx()` Same as `first()`, but returns `null` if set is empty.
`E` `floor(E e)`
`int` `hashCode()`
`NavigableSet<E>` `headSet(E toElement)`
`NavigableSet<E>` `headSet(E toElement, boolean inclusive)`
`E` `higher(E e)`
`boolean` `isEmpty()`
`Iterator<E>` `iterator()`
`E` `last()`
`E` `lastx()` Same as `last()`, but returns `null` if set is empty.
`E` `lower(E e)`
`E` `pollFirst()`
`E` `pollLast()`
`boolean` `remove(Object o)`
`boolean` `removeAll(Collection<?> c)`
`int` `size()`
`NavigableSet<E>` `subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)`
`NavigableSet<E>` `subSet(E fromElement, E toElement)`
`NavigableSet<E>` `tailSet(E fromElement)`
`NavigableSet<E>` `tailSet(E fromElement, boolean inclusive)`

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

`addAll, containsAll, retainAll, toArray, toArray, toString`

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

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

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

`spliterator`

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

`addAll, containsAll, retainAll, toArray, toArray`

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

`parallelStream, removeIf, stream`

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

`forEach`

### Constructor Detail

#### GridConcurrentSkipListSet

    public GridConcurrentSkipListSet()

Constructs a new, empty set that orders its elements according to their natural ordering.

#### GridConcurrentSkipListSet

    public GridConcurrentSkipListSet(Comparator<? super E> comp)

Constructs a new, empty set that orders its elements according to the specified comparator.

Parameters:
  `comp` - the comparator that will be used to order this set. If `null`, the natural ordering of the elements will be used.

#### GridConcurrentSkipListSet

    public GridConcurrentSkipListSet(Collection<? extends E> c)

Constructs a new set containing the elements in the specified collection, that orders its elements according to their natural ordering.

Parameters:
  `c` - The elements that will comprise the new set
Throws:
  `ClassCastException` - if the elements in `c` are not `Comparable`, or are not mutually comparable
  `NullPointerException` - if the specified collection or any of its elements are null

#### GridConcurrentSkipListSet

    public GridConcurrentSkipListSet(SortedSet<E> s)

Constructs a new set containing the same elements and using the same ordering as the specified sorted set.

Parameters:
  `s` - sorted set whose elements will comprise the new set
Throws:
  `NullPointerException` - if the specified sorted set or any of its elements are null

### Method Detail

#### clone

    public GridConcurrentSkipListSet<E> clone()

Overrides:
  `clone` in class `Object`

#### size

    public int size()

Specified by:
  `size` in interface `Collection<E>`
Specified by:
  `size` in interface `Set<E>`
Specified by:
  `size` in class `AbstractCollection<E>`

#### isEmpty

    public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Collection<E>`
Specified by:
  `isEmpty` in interface `Set<E>`
Overrides:
  `isEmpty` in class `AbstractCollection<E>`

#### contains

    public boolean contains(Object o)

Specified by:
  `contains` in interface `Collection<E>`
Specified by:
  `contains` in interface `Set<E>`
Overrides:
  `contains` in class `AbstractCollection<E>`

#### add

    public boolean add(E e)

Specified by:
  `add` in interface `Collection<E>`
Specified by:
  `add` in interface `Set<E>`
Overrides:
  `add` in class `AbstractCollection<E>`

#### remove

    public boolean remove(Object o)

Specified by:
  `remove` in interface `Collection<E>`
Specified by:
  `remove` in interface `Set<E>`
Overrides:
  `remove` in class `AbstractCollection<E>`

#### clear

    public void clear()

Specified by:
  `clear` in interface `Collection<E>`
Specified by:
  `clear` in interface `Set<E>`
Overrides:
  `clear` in class `AbstractCollection<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 `NavigableSet<E>`
Specified by:
  `iterator` in interface `Set<E>`
Specified by:
  `iterator` in class `AbstractCollection<E>`

#### descendingIterator

    public Iterator<E> descendingIterator()

Specified by:
  `descendingIterator` in interface `NavigableSet<E>`

#### equals

    public boolean equals(Object o)

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

#### hashCode

    public int hashCode()

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

#### removeAll

    public boolean removeAll(Collection<?> c)

Specified by:
  `removeAll` in interface `Collection<E>`
Specified by:
  `removeAll` in interface `Set<E>`
Overrides:
  `removeAll` in class `AbstractSet<E>`

#### lower

    public E lower(E e)

Specified by:
  `lower` in interface `NavigableSet<E>`

#### floor

    public E floor(E e)

Specified by:
  `floor` in interface `NavigableSet<E>`

#### ceiling

    public E ceiling(E e)

Specified by:
  `ceiling` in interface `NavigableSet<E>`

#### higher

    public E higher(E e)

Specified by:
  `higher` in interface `NavigableSet<E>`

#### pollFirst

    @Nullable
    public E pollFirst()

Specified by:
  `pollFirst` in interface `NavigableSet<E>`

#### pollLast

    @Nullable
    public E pollLast()

Specified by:
  `pollLast` in interface `NavigableSet<E>`

#### comparator

    public Comparator<? super E> comparator()

Specified by:
  `comparator` in interface `SortedSet<E>`

#### first

    public E first()

Specified by:
  `first` in interface `SortedSet<E>`

#### firstx

    @Nullable
    public E firstx()

Same as `first()`, but returns `null` if set is empty.

Returns:
  First entry or `null` if set is empty.

#### last

    public E last()

Specified by:
  `last` in interface `SortedSet<E>`

#### lastx

    @Nullable
    public E lastx()

Same as `last()`, but returns `null` if set is empty.

Returns:
  Last entry or `null` if set is empty.

#### subSet

    public NavigableSet<E> subSet(E fromElement,
                                  boolean fromInclusive,
                                  E toElement,
                                  boolean toInclusive)

Specified by:
  `subSet` in interface `NavigableSet<E>`

#### headSet

    public NavigableSet<E> headSet(E toElement,
                                   boolean inclusive)

Specified by:
  `headSet` in interface `NavigableSet<E>`

#### tailSet

    public NavigableSet<E> tailSet(E fromElement,
                                   boolean inclusive)

Specified by:
  `tailSet` in interface `NavigableSet<E>`

#### subSet

    public NavigableSet<E> subSet(E fromElement,
                                  E toElement)

Specified by:
  `subSet` in interface `NavigableSet<E>`
Specified by:
  `subSet` in interface `SortedSet<E>`

#### headSet

    public NavigableSet<E> headSet(E toElement)

Specified by:
  `headSet` in interface `NavigableSet<E>`
Specified by:
  `headSet` in interface `SortedSet<E>`

#### tailSet

    public NavigableSet<E> tailSet(E fromElement)

Specified by:
  `tailSet` in interface `NavigableSet<E>`
Specified by:
  `tailSet` in interface `SortedSet<E>`

#### descendingSet

    public NavigableSet<E> descendingSet()

Specified by:
  `descendingSet` in interface `NavigableSet<E>`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019