public class ArrayObjectQueue<E> extends java.lang.Object implements ObjectQueue<E>
Constructor and Description |
---|
ArrayObjectQueue() |
ArrayObjectQueue(int initialCapacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
void |
clear() |
int |
getCurrentCapacity() |
protected void |
grow() |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
void |
process(Processor<E> processor)
call Processor.process(e) on each queued object
This method does not return before the queue is empty, which makes it
suitable for graph traversal.
|
E |
remove() |
int |
size() |
java.util.Iterator<E> |
storageIterator() |
public ArrayObjectQueue()
public ArrayObjectQueue(int initialCapacity)
protected void grow()
public boolean isEmpty()
isEmpty
in interface ObjectQueue<E>
public int getCurrentCapacity()
public int size()
size
in interface ObjectQueue<E>
public boolean offer(E e)
offer
in interface ObjectQueue<E>
public boolean add(E e)
add
in interface ObjectQueue<E>
public E poll()
poll
in interface ObjectQueue<E>
public E remove() throws java.util.NoSuchElementException
remove
in interface ObjectQueue<E>
java.util.NoSuchElementException
public E peek()
peek
in interface ObjectQueue<E>
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
public java.util.Iterator<E> storageIterator()
public void clear()
clear
in interface ObjectQueue<E>
public void process(Processor<E> processor)
process
in interface ObjectQueue<E>