T
- public interface MessageQueue<T>
extends java.lang.Iterable<T>
Modifier and Type | Method and Description |
---|---|
boolean |
add(T e)
Adds an element
|
void |
addFirst(T e)
Add an element
|
void |
clear()
Removes all of the elements
|
T |
element()
Retrieves, but does not remove, the head of this queue.
|
boolean |
isEmpty()
Determines if queue is empty.
|
boolean |
offer(T e)
Inserts the specified element into this queue if it is possible to do
so immediately without violating capacity restrictions.
|
T |
peek()
Retrieves
|
T |
peekLast()
Retrieves
null
if this queue is empty. |
T |
poll()
Retrieves and removes the head of this queue,
or returns null if this queue is empty.
|
T |
remove()
Retrieves and removes the head of this queue.
|
int |
size()
Returns the number of elements in this collection.
|
boolean add(T e)
e
- the element to add, not null
.java.lang.NullPointerException
- if the specified element is nullboolean offer(T e)
add(T)
, which can fail to insert an element only
by throwing an exception.e
- the element to addjava.lang.ClassCastException
- if the class of the specified element
prevents it from being added to this queuejava.lang.NullPointerException
- if the specified element is null and
this queue does not permit null elementsjava.lang.IllegalArgumentException
- if some property of this element
prevents it from being added to this queueT peek()
void addFirst(T e)
e
- the message to add, not null
.java.lang.NullPointerException
- if the specified element is nullT peekLast()
null
if this queue is empty.null
if empty queue.void clear()
boolean isEmpty()
true
if queue is empty.T remove()
poll
only in that it throws an exception if this
queue is empty.java.util.NoSuchElementException
- if this queue is emptyT poll()
T element()
peek
only in that it throws an exception
if this queue is empty.java.util.NoSuchElementException
- if this queue is emptyint size()
Copyright © OpenCloud. All Rights Reserved.