org.tinygroup.queue.impl
类 QueueImpl<E>

java.lang.Object
  继承者 org.tinygroup.queue.impl.QueueImpl<E>
所有已实现的接口:
Queue<E>, QueueMonitor

public class QueueImpl<E>
extends Object
implements Queue<E>

Created by IntelliJ IDEA. User: luoguo Date: 11-3-30 Time: 下午1:37 To change this template use File | Settings | File Templates.


字段摘要
 
从接口 org.tinygroup.queue.Queue 继承的字段
DEFAULT_QUEUE_SIZE
 
构造方法摘要
QueueImpl()
          构造函数
QueueImpl(int size)
          构造函数
QueueImpl(String name)
          构造函数
QueueImpl(String name, int size)
          构造函数
 
方法摘要
 E element()
          获取队列头元素
 int getIdleSize()
          获取空闲队列长度
 String getName()
          获取队列名称
 int getSize()
          获取队列长度
 int getUsingSize()
          获取已用队列长度
 boolean isEmpty()
          检查队列是否为空
 boolean isFull()
          检查队列是否为满
 void offer(E o)
          添加元素到队列中
 E peek()
          获取队列头元素
 E poll()
          元素出队,并删除 返回所删除的元素
 E remove()
          元素出队,并删除 返回所删除的元素
 void setName(String name)
          设置队列名称
 int size()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

QueueImpl

public QueueImpl()
构造函数


QueueImpl

public QueueImpl(String name)
构造函数

参数:
name -

QueueImpl

public QueueImpl(String name,
                 int size)
构造函数

参数:
name -
size -

QueueImpl

public QueueImpl(int size)
构造函数

参数:
size -
方法详细信息

offer

public void offer(E o)
添加元素到队列中

指定者:
接口 Queue<E> 中的 offer
参数:
o -

poll

public E poll()
元素出队,并删除 返回所删除的元素

指定者:
接口 Queue<E> 中的 poll
返回:
E

remove

public E remove()
元素出队,并删除 返回所删除的元素

指定者:
接口 Queue<E> 中的 remove
返回:
E

peek

public E peek()
获取队列头元素

指定者:
接口 Queue<E> 中的 peek
返回:
E

element

public E element()
获取队列头元素

指定者:
接口 Queue<E> 中的 element
返回:
E

isEmpty

public boolean isEmpty()
检查队列是否为空

指定者:
接口 Queue<E> 中的 isEmpty
返回:

isFull

public boolean isFull()
检查队列是否为满

指定者:
接口 Queue<E> 中的 isFull
返回:

setName

public void setName(String name)
设置队列名称

参数:
name -

getName

public String getName()
获取队列名称

指定者:
接口 QueueMonitor 中的 getName
返回:
String

getSize

public int getSize()
获取队列长度

指定者:
接口 QueueMonitor 中的 getSize
返回:
int

getUsingSize

public int getUsingSize()
获取已用队列长度

指定者:
接口 QueueMonitor 中的 getUsingSize
返回:
int

getIdleSize

public int getIdleSize()
获取空闲队列长度

指定者:
接口 QueueMonitor 中的 getIdleSize
返回:
int

size

public int size()
指定者:
接口 Queue<E> 中的 size


Copyright © 2006–2016 TinyGroup. All rights reserved.