public class ConcurrentSkipListPriorityQueue<E>
extends java.util.AbstractQueue<E>
implements java.lang.Cloneable, java.io.Serializable
| Constructor and Description |
|---|
ConcurrentSkipListPriorityQueue()
Constructs a new, empty map, sorted according to the
natural ordering of the keys.
|
ConcurrentSkipListPriorityQueue(java.util.Collection<? extends E> m) |
ConcurrentSkipListPriorityQueue(java.util.Comparator<? super E> comparator)
Constructs a new, empty map, sorted according to the specified
comparator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all of the mappings from this map.
|
ConcurrentSkipListPriorityQueue<E> |
clone()
Returns a shallow copy of this ConcurrentSkipListMap
instance.
|
java.util.Comparator<? super E> |
comparator() |
boolean |
contains(java.lang.Object key) |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
java.util.Iterator<E> |
iterator() |
boolean |
offer(E key) |
E |
peek() |
E |
peekLast() |
E |
poll() |
boolean |
remove(java.lang.Object key) |
int |
size()
Returns the number of key-value mappings in this map.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
containsAll, removeAll, retainAll, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic ConcurrentSkipListPriorityQueue()
public ConcurrentSkipListPriorityQueue(java.util.Comparator<? super E> comparator)
comparator - the comparator that will be used to order this map.
If null, the natural
ordering of the keys will be used.public ConcurrentSkipListPriorityQueue(java.util.Collection<? extends E> m)
public ConcurrentSkipListPriorityQueue<E> clone()
clone in class java.lang.Objectpublic boolean contains(java.lang.Object key)
public E peekLast()
public java.util.Iterator<E> iterator()
public boolean remove(java.lang.Object key)
public int size()
Beware that, unlike in most collections, this method is NOT a constant-time operation. Because of the asynchronous nature of these maps, determining the current number of elements requires traversing them all to count them. Additionally, it is possible for the size to change during execution of this method, in which case the returned result will be inaccurate. Thus, this method is typically not very useful in concurrent applications.
public boolean isEmpty()
public void clear()
public java.util.Comparator<? super E> comparator()
public java.lang.Object[] toArray()