public interface CircularQueue<E>
Modifier and Type | Method and Description |
---|---|
void |
addAll(java.util.Collection<? extends E> collection)
Appends all of the elements in the specified collection to the end of this queue, in the order that they are returned by the specified collection's iterator.
|
void |
clear()
Removes all of the elements from this queue.
|
boolean |
contains(E element)
Returns true if this queue contains the specified element.
|
boolean |
isEmpty()
Returns true if this queue contains no elements.
|
void |
offer(E element)
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.
|
E |
poll()
Retrieves and removes the head of this queue, or returns null if this queue is empty.
|
int |
size()
Returns the number of elements in this queue.
|
E[] |
toArray(E[] a)
Returns an array containing all of the elements in this queue, in proper sequence; the runtime type of the returned array is that of the specified array.
|
void offer(E element)
Violating capacity restrictions will result in a removal of an element at the head of the queue to accommodate space in the queue for a newly added element.
element
- to addE poll()
Queue.poll()
void addAll(java.util.Collection<? extends E> collection)
collection
- the elements to be inserted into this queueCollection.addAll(Collection)
boolean isEmpty()
Collection.isEmpty()
int size()
Collection.size()
void clear()
Collection.clear()
E[] toArray(E[] a)
a
- The array into which the elements of the queue are to be stored.Collection.toArray(Object[])
boolean contains(E element)
element
- to look for in the queue