BlockingQueue.offer

Inserts the specified element into this queue 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 queue, this method is generally preferable to {@link #add}, which can fail to insert an element only by throwing an exception.

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

  1. bool offer(E e)
    interface BlockingQueue(E)
    bool
    offer
    (
    E e
    )
  2. bool offer(E e, Duration timeout)

Meta