public class PriorityQueueImpl<T> extends Object implements PriorityQueue<T>, QueueMonitor
DEFAULT_QUEUE_SIZE
Constructor and Description |
---|
PriorityQueueImpl() |
PriorityQueueImpl(int size) |
PriorityQueueImpl(int size,
int priorityLevel)
构造函数
|
Modifier and Type | Method and Description |
---|---|
T |
element()
从队列头部取一个元素,但是不删除。如果队列为空,则抛出异常
|
int |
getCallTimes() |
int |
getCount() |
List<org.tinygroup.queue.impl.PriorityQueueImpl.DateQueue<T>>[] |
getDateQueueListArray() |
int |
getIdleSize()
返回空闲长度
|
String |
getName()
返回名字
|
PriorityIncreaseStrategy<T> |
getPriorityIncreaseStrategy() |
int |
getPriorityLevel() |
int |
getReverseLevel() |
int |
getSize()
返回队列大小
|
PriorityIncreaseStrategy<T> |
getStrategy() |
int |
getTimeslice() |
int |
getUsingSize()
返回队列长度
|
boolean |
isEmpty()
返回队列是否为空
|
boolean |
isFull()
返回是否满
|
void |
offer(T o)
添加元素到队列中.
|
void |
offer(T o,
int pPriority)
添加元素到队列中.
|
T |
peek()
从队列头部取一个元素,但是不删除。如果队列为空,则返回NULL
|
T |
poll()
从队列头部取一个数据并且把它删除掉,如果队列为空,则返回NULL
|
T |
remove()
从队列头部取一个元素并且把它删除掉,如果队列为空,则抛出异常
|
void |
setName(String name) |
void |
setPriorityIncreaseStrategy(PriorityIncreaseStrategy<T> strategy) |
void |
setReverseLevel(int reverseLevel) |
void |
setTimeslice(int timeslice) |
int |
size() |
public PriorityQueueImpl()
public PriorityQueueImpl(int size)
size
- public PriorityQueueImpl(int size, int priorityLevel)
size
- 如果是0,表示不限制大小priorityLevel
- public int getPriorityLevel()
public int getCount()
public List<org.tinygroup.queue.impl.PriorityQueueImpl.DateQueue<T>>[] getDateQueueListArray()
public int getCallTimes()
public PriorityIncreaseStrategy<T> getStrategy()
public PriorityIncreaseStrategy<T> getPriorityIncreaseStrategy()
public void setPriorityIncreaseStrategy(PriorityIncreaseStrategy<T> strategy)
setPriorityIncreaseStrategy
in interface PriorityQueue<T>
public int getReverseLevel()
public void setReverseLevel(int reverseLevel)
public int getTimeslice()
public void setTimeslice(int timeslice)
public void offer(T o, int pPriority)
PriorityQueue
offer
in interface PriorityQueue<T>
o
- pPriority
- 从1开始public boolean isEmpty()
Queue
public boolean isFull()
Queue
public String getName()
QueueMonitor
getName
in interface QueueMonitor
public void setName(String name)
public int getSize()
QueueMonitor
getSize
in interface QueueMonitor
public int getUsingSize()
QueueMonitor
getUsingSize
in interface QueueMonitor
public int getIdleSize()
QueueMonitor
getIdleSize
in interface QueueMonitor
Copyright © 2006–2018 TinyGroup. All rights reserved.