|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
E
- The type of Object that the queue will accept.public interface QueueInterface<E>
Generic interface for a FIFO queue.
Method Summary | |
---|---|
boolean |
add(E e)
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available. |
E |
element()
Retrieves, but does not remove, the head of this queue. |
boolean |
isEmpty()
This method is called to determine if the queue is empty. |
E |
remove()
Retrieves and removes the element at the head of this queue. |
E |
remove(int index)
Retrieves and removes the element at the specified index. |
void |
removeAll()
Removes all elements from the queue. |
int |
size()
This method is called to obtain the count of elements in the list. |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
boolean isEmpty()
int size()
boolean add(E e) throws java.lang.IllegalStateException, java.lang.NullPointerException
e
- The element to add.
true
if the element was successfully added.
java.lang.IllegalStateException
- If the element cannot be added at this time due to capacity restrictions.
java.lang.NullPointerException
- If the specified element is null and this queue does not permit null elements.E element() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- If the queue is empty.E remove() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- If the queue is empty.E remove(int index) throws java.util.NoSuchElementException
index
- The index of the element to be removed.
java.util.NoSuchElementException
- If the queue is empty.void removeAll()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |