public interface QueueProducer<E>
Modifier and Type | Method and Description |
---|---|
boolean |
offer(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 false if no
space is currently available. |
boolean |
offer(E e,
long timeout,
java.util.concurrent.TimeUnit unit)
Inserts the specified element into this queue, waiting up to the specified wait time if
necessary for space to become available.
|
void |
put(E e)
Inserts the specified element into this queue, waiting if necessary for space to become
available.
|
boolean offer(E e)
true
upon success and false
if no
space is currently available.e
- the element to addtrue
if the element was added to this queue, else false
java.lang.ClassCastException
- if the class of the specified element prevents it from being added
to this queuejava.lang.NullPointerException
- if the specified element is nulljava.lang.IllegalArgumentException
- if some property of the specified element prevents it from
being added to this queuevoid put(E e) throws java.lang.InterruptedException
e
- the element to addjava.lang.InterruptedException
- if interrupted while waitingjava.lang.ClassCastException
- if the class of the specified element prevents it from being added
to this queuejava.lang.NullPointerException
- if the specified element is nulljava.lang.IllegalArgumentException
- if some property of the specified element prevents it from
being added to this queueboolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
e
- the element to addtimeout
- how long to wait before giving up, in units of unit
unit
- a TimeUnit
determining how to interpret the timeout
parametertrue
if successful, or false
if the specified waiting time elapses
before space is availablejava.lang.InterruptedException
- if interrupted while waitingjava.lang.ClassCastException
- if the class of the specified element prevents it from being added
to this queuejava.lang.NullPointerException
- if the specified element is nulljava.lang.IllegalArgumentException
- if some property of the specified element prevents it from
being added to this queue