public class GridConcurrentSkipListSet<E> extends GridSerializableSet<E> implements NavigableSet<E>, Cloneable
ConcurrentSkipListSet
. It adds
methods firstx()
and lastx()
, which unlike first()
and last()
methods return null
for empty sets instead of
throwing NoSuchElementException
.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.
|
Modifier and Type | Method and Description |
---|---|
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) |
addAll, containsAll, retainAll, toArray, toArray, toString
public GridConcurrentSkipListSet()
public GridConcurrentSkipListSet(Comparator<? super E> comp)
comp
- the comparator that will be used to order this set.
If null, the natural
ordering of the elements will be used.public GridConcurrentSkipListSet(Collection<? extends E> c)
c
- The elements that will comprise the new setClassCastException
- if the elements in c are
not Comparable
, or are not mutually comparableNullPointerException
- if the specified collection or any
of its elements are nullpublic GridConcurrentSkipListSet(SortedSet<E> s)
s
- sorted set whose elements will comprise the new setNullPointerException
- if the specified sorted set or any
of its elements are nullpublic GridConcurrentSkipListSet<E> clone()
public int size()
size
in interface Collection<E>
size
in interface Set<E>
size
in class AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface Set<E>
isEmpty
in class AbstractCollection<E>
public boolean contains(Object o)
contains
in interface Collection<E>
contains
in interface Set<E>
contains
in class AbstractCollection<E>
public boolean add(E e)
add
in interface Collection<E>
add
in interface Set<E>
add
in class AbstractCollection<E>
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class AbstractCollection<E>
public void clear()
clear
in interface Collection<E>
clear
in interface Set<E>
clear
in class AbstractCollection<E>
public Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in interface NavigableSet<E>
iterator
in interface Set<E>
iterator
in class AbstractCollection<E>
public Iterator<E> descendingIterator()
descendingIterator
in interface NavigableSet<E>
public boolean equals(Object o)
equals
in interface Collection<E>
equals
in interface Set<E>
equals
in class AbstractSet<E>
public int hashCode()
hashCode
in interface Collection<E>
hashCode
in interface Set<E>
hashCode
in class AbstractSet<E>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
removeAll
in class AbstractSet<E>
public E lower(E e)
lower
in interface NavigableSet<E>
public E floor(E e)
floor
in interface NavigableSet<E>
public E ceiling(E e)
ceiling
in interface NavigableSet<E>
public E higher(E e)
higher
in interface NavigableSet<E>
@Nullable public E pollFirst()
pollFirst
in interface NavigableSet<E>
@Nullable public E pollLast()
pollLast
in interface NavigableSet<E>
public Comparator<? super E> comparator()
comparator
in interface SortedSet<E>
@Nullable public E firstx()
first()
, but returns null
if set is empty.null
if set is empty.@Nullable public E lastx()
last()
, but returns null
if set is empty.null
if set is empty.public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
subSet
in interface NavigableSet<E>
public NavigableSet<E> headSet(E toElement, boolean inclusive)
headSet
in interface NavigableSet<E>
public NavigableSet<E> tailSet(E fromElement, boolean inclusive)
tailSet
in interface NavigableSet<E>
public NavigableSet<E> subSet(E fromElement, E toElement)
public NavigableSet<E> headSet(E toElement)
public NavigableSet<E> tailSet(E fromElement)
public NavigableSet<E> descendingSet()
descendingSet
in interface NavigableSet<E>
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017