public class PriorityLinkedListImpl<T> extends Object implements PriorityLinkedList<T>
It implements this by maintaining an individual LinkedBlockingDeque for each priority level.
Modifier and Type | Field and Description |
---|---|
protected LinkedListImpl<T>[] |
levels |
Constructor and Description |
---|
PriorityLinkedListImpl(int priorities) |
Modifier and Type | Method and Description |
---|---|
void |
addHead(T t,
int priority) |
void |
addTail(T t,
int priority) |
void |
clear() |
boolean |
isEmpty()
Returns
true if empty, false otherwise.It is safe to be called concurrently. |
LinkedListIterator<T> |
iterator() |
T |
poll() |
int |
size()
Returns the size of this list.
It is safe to be called concurrently. |
protected LinkedListImpl<T>[] levels
public void addHead(T t, int priority)
addHead
in interface PriorityLinkedList<T>
public void addTail(T t, int priority)
addTail
in interface PriorityLinkedList<T>
public T poll()
poll
in interface PriorityLinkedList<T>
public void clear()
clear
in interface PriorityLinkedList<T>
public int size()
PriorityLinkedList
size
in interface PriorityLinkedList<T>
public boolean isEmpty()
PriorityLinkedList
true
if empty, false
otherwise.isEmpty
in interface PriorityLinkedList<T>
public LinkedListIterator<T> iterator()
iterator
in interface PriorityLinkedList<T>
Copyright © 2018 JBoss by Red Hat. All rights reserved.