|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractQueue<E> org.amino.ds.lockfree.LockFreePriorityQueue<E>
E
- type of element in the priority queuepublic class LockFreePriorityQueue<E>
It is a thread-safe and lock-free queue. This lock free priority queue implementation, which based on the algorithm defined in the follwoing paper: Fast and Lock-Free Concurrent Priority Queues for Multi-Thread Systems By Hakan Sundell and Philippas Tsigas
Constructor Summary | |
---|---|
LockFreePriorityQueue()
default constructor. |
|
LockFreePriorityQueue(java.util.Comparator<? super E> cmp)
|
Method Summary | |
---|---|
boolean |
add(E d)
|
boolean |
contains(java.lang.Object o)
|
boolean |
isEmpty()
|
java.util.Iterator<E> |
iterator()
|
boolean |
offer(E e)
|
E |
peek()
|
E |
peekFirst()
|
E |
poll()
|
int |
size()
|
Methods inherited from class java.util.AbstractQueue |
---|
addAll, clear, element, remove |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public LockFreePriorityQueue()
public LockFreePriorityQueue(java.util.Comparator<? super E> cmp)
cmp
- customized comparatorMethod Detail |
---|
public int size()
size
in interface java.util.Collection<E>
size
in class java.util.AbstractCollection<E>
public E peek()
public boolean offer(E e)
public E peekFirst()
public E poll()
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
contains
in class java.util.AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
isEmpty
in class java.util.AbstractCollection<E>
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in class java.util.AbstractCollection<E>
public boolean add(E d)
add
in interface java.util.Collection<E>
add
in interface java.util.Queue<E>
add
in class java.util.AbstractQueue<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |