org.eclipse.jetty.util
类 ArrayQueue<E>

java.lang.Object
  继承者 java.util.AbstractCollection<E>
      继承者 java.util.AbstractList<E>
          继承者 org.eclipse.jetty.util.ArrayQueue<E>
类型参数:
E -
所有已实现的接口:
Iterable<E>, Collection<E>, List<E>, Queue<E>

public class ArrayQueue<E>
extends AbstractList<E>
implements Queue<E>

Queue backed by circular array.

This partial Queue implementation (also with remove() for stack operation) is backed by a growable circular array.


字段摘要
protected  Object[] _elements
           
protected  int _growCapacity
           
protected  Object _lock
           
protected  int _nextE
           
protected  int _nextSlot
           
protected  int _size
           
static int DEFAULT_CAPACITY
           
static int DEFAULT_GROWTH
           
 
从类 java.util.AbstractList 继承的字段
modCount
 
构造方法摘要
ArrayQueue()
           
ArrayQueue(int capacity)
           
ArrayQueue(int initCapacity, int growBy)
           
ArrayQueue(int initCapacity, int growBy, Object lock)
           
 
方法摘要
 boolean add(E e)
           
 void add(int index, E element)
           
 void addUnsafe(E e)
          Add without synchronization or bounds checking
 void clear()
           
 E element()
           
 E get(int index)
           
 int getCapacity()
           
 E getUnsafe(int index)
          Get without synchronization or bounds checking.
protected  boolean grow()
           
 boolean isEmpty()
           
 boolean offer(E e)
           
 E peek()
           
 E poll()
           
 E remove()
           
 E remove(int index)
           
 E set(int index, E element)
           
 int size()
           
 
从类 java.util.AbstractList 继承的方法
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
从类 java.util.AbstractCollection 继承的方法
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
从接口 java.util.Collection 继承的方法
addAll, contains, containsAll, equals, hashCode, iterator, remove, removeAll, retainAll, toArray, toArray
 
从接口 java.util.List 继承的方法
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray
 

字段详细信息

DEFAULT_CAPACITY

public static final int DEFAULT_CAPACITY
另请参见:
常量字段值

DEFAULT_GROWTH

public static final int DEFAULT_GROWTH
另请参见:
常量字段值

_lock

protected final Object _lock

_growCapacity

protected final int _growCapacity

_elements

protected Object[] _elements

_nextE

protected int _nextE

_nextSlot

protected int _nextSlot

_size

protected int _size
构造方法详细信息

ArrayQueue

public ArrayQueue()

ArrayQueue

public ArrayQueue(int capacity)

ArrayQueue

public ArrayQueue(int initCapacity,
                  int growBy)

ArrayQueue

public ArrayQueue(int initCapacity,
                  int growBy,
                  Object lock)
方法详细信息

getCapacity

public int getCapacity()

add

public boolean add(E e)
指定者:
接口 Collection<E> 中的 add
指定者:
接口 List<E> 中的 add
指定者:
接口 Queue<E> 中的 add
覆盖:
AbstractList<E> 中的 add

offer

public boolean offer(E e)
指定者:
接口 Queue<E> 中的 offer

addUnsafe

public void addUnsafe(E e)
Add without synchronization or bounds checking

参数:
e - the element to add
另请参见:
add(Object)

element

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

peek

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

poll

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

remove

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

clear

public void clear()
指定者:
接口 Collection<E> 中的 clear
指定者:
接口 List<E> 中的 clear
覆盖:
AbstractList<E> 中的 clear

isEmpty

public boolean isEmpty()
指定者:
接口 Collection<E> 中的 isEmpty
指定者:
接口 List<E> 中的 isEmpty
覆盖:
AbstractCollection<E> 中的 isEmpty

size

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

get

public E get(int index)
指定者:
接口 List<E> 中的 get
指定者:
AbstractList<E> 中的 get

getUnsafe

public E getUnsafe(int index)
Get without synchronization or bounds checking.

参数:
index - index of the element to return
返回:
the element at the specified index
另请参见:
get(int)

remove

public E remove(int index)
指定者:
接口 List<E> 中的 remove
覆盖:
AbstractList<E> 中的 remove

set

public E set(int index,
             E element)
指定者:
接口 List<E> 中的 set
覆盖:
AbstractList<E> 中的 set

add

public void add(int index,
                E element)
指定者:
接口 List<E> 中的 add
覆盖:
AbstractList<E> 中的 add

grow

protected boolean grow()


Copyright © 2013. All Rights Reserved.