org.tinygroup.queue
Interface Queue<E>

All Superinterfaces:
QueueMonitor
All Known Subinterfaces:
PriorityQueue<E>
All Known Implementing Classes:
PriorityQueueImpl, QueueImpl

public interface Queue<E>
extends QueueMonitor

队列接口 Created by IntelliJ IDEA. User: luoguo


Field Summary
static int DEFAULT_QUEUE_SIZE
          默认优先队列大小
 
Method Summary
 E element()
          从队列头部取一个元素,但是不删除。如果队列为空,则抛出异常
 boolean isEmpty()
          返回队列是否为空
 boolean isFull()
          返回是否满
 void offer(E e)
          添加元素到队列中.
 E peek()
          从队列头部取一个元素,但是不删除。如果队列为空,则返回NULL
 E poll()
          从队列头部取一个数据并且把它删除掉,如果队列为空,则返回NULL
 E remove()
          从队列头部取一个元素并且把它删除掉,如果队列为空,则抛出异常
 int size()
           
 
Methods inherited from interface org.tinygroup.queue.QueueMonitor
getIdleSize, getName, getSize, getUsingSize
 

Field Detail

DEFAULT_QUEUE_SIZE

static final int DEFAULT_QUEUE_SIZE
默认优先队列大小

See Also:
Constant Field Values
Method Detail

offer

void offer(E e)
添加元素到队列中.

Parameters:
e - 要增加的元素

poll

E poll()
从队列头部取一个数据并且把它删除掉,如果队列为空,则返回NULL

Returns:
元素

remove

E remove()
从队列头部取一个元素并且把它删除掉,如果队列为空,则抛出异常

Returns:

peek

E peek()
从队列头部取一个元素,但是不删除。如果队列为空,则返回NULL

Returns:

size

int size()

element

E element()
从队列头部取一个元素,但是不删除。如果队列为空,则抛出异常

Returns:

isEmpty

boolean isEmpty()
返回队列是否为空

Returns:

isFull

boolean isFull()
返回是否满

Returns:


Copyright © 2006–2015 TinyGroup. All rights reserved.