Type Parameters:
E - the type of elements held in this queue
All Superinterfaces:
Collection<E>, Iterable<E>
All Known Subinterfaces:
BlockingDeque<E>, BlockingQueue<E>, Deque<E>, TransferQueue<E>
All Known Implementing Classes:
AbstractQueue, ArrayBlockingQueue, ArrayDeque, ConcurrentLinkedDeque, ConcurrentLinkedQueue, DelayQueue, LinkedBlockingDeque, LinkedBlockingQueue, LinkedList, LinkedTransferQueue, PriorityBlockingQueue, PriorityQueue, SynchronousQueue

  • 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.

    element()

    Retrieves, but does not remove, the head of this queue.

    boolean

    offer(E e)

    Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.

    peek()

    Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.

    poll()

    Retrieves and removes the head of this queue, or returns null if this queue is empty.

    remove()

    Retrieves and removes the head of this queue.

    Methods declared in interface Collection

    addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray

    boolean

    Adds all of the elements in the specified collection to this collection (optional operation).

    void

    Removes all of the elements from this collection (optional operation).

    boolean

    Returns true if this collection contains the specified element.

    boolean

    Returns true if this collection contains all of the elements in the specified collection.

    boolean

    Compares the specified object with this collection for equality.

    int

    Returns the hash code value for this collection.

    boolean

    Returns true if this collection contains no elements.

    Returns an iterator over the elements in this collection.

    Returns a possibly parallel Stream with this collection as its source.

    boolean

    Removes a single instance of the specified element from this collection, if it is present (optional operation).

    boolean

    Removes all of this collection's elements that are also contained in the specified collection (optional operation).

    default boolean

    Removes all of the elements of this collection that satisfy the given predicate (optional operation).

    boolean

    Retains only the elements in this collection that are contained in the specified collection (optional operation).

    int

    Returns the number of elements in this collection.

    Creates a Spliterator over the elements in this collection.

    Returns a sequential Stream with this collection as its source.

    Returns an array containing all of the elements in this collection.

    default <T> T[]

    Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array.

    <T> T[]

    Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.

    Methods declared in interface Iterable

    forEach

    default void

    Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.

  • Method Details

    • add

    • offer

    • remove

    • poll

    • element

    • peek