public interface IQueue<E>
| Modifier and Type | Method and Description |
|---|---|
void |
add(E item)
Inserts the specified element into this queue,
returning true upon success.
|
void |
clear()
Removes all of the elements from this queue.
|
boolean |
contains(Object o)
Returns true if this queue contains the specified element.
|
E |
element()
Retrieves, but does not remove, the head of this queue.
|
boolean |
isEmpty()
Returns true if this queue contains no elements.
|
boolean |
offer(E e)
Inserts the specified element into this queue if it is possible to do so
immediately without violating capacity restrictions.
|
E |
peek()
Retrieves, but does not remove, the head of this queue.
|
E |
poll()
Retrieves and removes the head of this queue.
|
E |
remove()
Retrieves and removes the head of this queue.
|
int |
size()
Returns the number of elements in this queue.
|
String |
toString()
Returns a string representation of this queue.
|
void add(E item)
This method throws an IllegalStateException if no space is available to hold the new item.
item - the item to addIllegalStateException - if the queue is fullboolean offer(E e)
e - the element to addE poll()
E remove()
NoSuchElementException - if this queue is emptyE peek()
E element()
NoSuchElementException - if this queue is emptyboolean isEmpty()
int size()
void clear()
String toString()
boolean contains(Object o)
o - object to be checked for containment in this queue