E
- public class ArrayQueue<E> extends AbstractList<E> implements Queue<E>
#pop()
for stack operation)
is backed by a growable circular array.Modifier and Type | Field and Description |
---|---|
protected Object[] |
_elements |
protected int |
_growCapacity |
protected Object |
_lock |
protected int |
_nextE |
protected int |
_nextSlot |
protected int |
_size |
int |
DEFAULT_CAPACITY |
int |
DEFAULT_GROWTH |
modCount
Constructor and Description |
---|
ArrayQueue() |
ArrayQueue(int capacity) |
ArrayQueue(int initCapacity,
int growBy) |
ArrayQueue(int initCapacity,
int growBy,
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 final int DEFAULT_CAPACITY
public final int DEFAULT_GROWTH
protected Object _lock
protected Object[] _elements
protected int _nextE
protected int _nextSlot
protected int _size
protected int _growCapacity
public ArrayQueue()
public ArrayQueue(int capacity)
public ArrayQueue(int initCapacity, int growBy)
public ArrayQueue(int initCapacity, int growBy, Object lock)
public int getCapacity()
public boolean add(E e)
public void addUnsafe(E e)
add(Object)
public void clear()
clear
in interface Collection<E>
clear
in interface List<E>
clear
in class AbstractList<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface List<E>
isEmpty
in class AbstractCollection<E>
public int size()
size
in interface Collection<E>
size
in interface List<E>
size
in class AbstractCollection<E>
public E get(int index)
public E getUnsafe(int index)
get(int)
public E remove(int index)
public void add(int index, E element)
protected boolean grow()
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.