org.eclipse.jetty.util
E
- public class ArrayQueue<E> extends java.util.AbstractList<E> implements java.util.Queue<E>
remove()
for stack operation)
is backed by a growable circular array.Modifier and Type | Field and Description |
---|---|
protected java.lang.Object[] |
_elements |
protected int |
_growCapacity |
protected java.lang.Object |
_lock |
protected int |
_nextE |
protected int |
_nextSlot |
protected int |
_size |
static int |
DEFAULT_CAPACITY |
static int |
DEFAULT_GROWTH |
Constructor and Description |
---|
ArrayQueue() |
ArrayQueue(int capacity) |
ArrayQueue(int initCapacity,
int growBy) |
ArrayQueue(int initCapacity,
int growBy,
java.lang.Object lock) |
Modifier and Type | Method and Description |
---|---|
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() |
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static final int DEFAULT_CAPACITY
public static final int DEFAULT_GROWTH
protected final java.lang.Object _lock
protected final int _growCapacity
protected java.lang.Object[] _elements
protected int _nextE
protected int _nextSlot
protected int _size
public ArrayQueue()
public ArrayQueue(int capacity)
public ArrayQueue(int initCapacity, int growBy)
public ArrayQueue(int initCapacity, int growBy, java.lang.Object lock)
public int getCapacity()
public boolean add(E e)
public void addUnsafe(E e)
e
- the element to addadd(Object)
public void clear()
public boolean isEmpty()
public int size()
public E get(int index)
public E getUnsafe(int index)
index
- index of the element to returnget(int)
public E remove(int index)
public void add(int index, E element)
protected boolean grow()
Copyright © 2013. All Rights Reserved.