Deque.offer

Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque) if it is possible to do so immediately without violating capacity restrictions, returning {@code true} upon success and {@code false} if no space is currently available. When using a capacity-restricted deque, this method is generally preferable to the {@link #add} method, which can fail to insert an element only by throwing an exception.

<p>This method is equivalent to {@link #offerLast}.

@param e the element to add @return {@code true} if the element was added to this deque, else {@code false} @throws ClassCastException if the class of the specified element prevents it from being added to this deque @throws NullPointerException if the specified element is null and this deque does not permit null elements @throws IllegalArgumentException if some property of the specified element prevents it from being added to this deque

interface Deque(E)
bool
offer
(
E e
)

Meta