Type Parameters:
E - the type of elements held in this queue
All Implemented Interfaces:
Iterable<E>, Collection<E>, Queue<E>
Direct Known Subclasses:
ArrayBlockingQueue, ConcurrentLinkedQueue, DelayQueue, LinkedBlockingDeque, LinkedBlockingQueue, LinkedTransferQueue, PriorityBlockingQueue, PriorityQueue, SynchronousQueue

  • Constructor Summary

    Constructors

    protected

    Constructor for use by subclasses.

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

    boolean

    Adds all of the elements in the specified collection to this queue.

    void

    clear()

    Removes all of the elements from this queue.

    element()

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

    remove()

    Retrieves and removes the head of this queue.

    Methods declared in class AbstractCollection

    contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray, toString

    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

    Returns true if this collection contains no elements.

    Returns an iterator over the elements contained in this collection.

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

    boolean

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

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

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

    Returns a string representation of this collection.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Creates and returns a copy of this object.

    boolean

    Indicates whether some other object is "equal to" this one.

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    int

    Returns a hash code value for this object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(long timeoutMillis)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    final void

    wait(long timeoutMillis, int nanos)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    Methods declared in interface Collection

    equals, hashCode, parallelStream, removeIf, size, spliterator, stream, toArray

    boolean

    Compares the specified object with this collection for equality.

    int

    Returns the hash code value for this collection.

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

    default boolean

    Removes all of the elements of this collection that satisfy the given predicate (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.

    default <T> T[]

    Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned 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.

    Methods declared in interface Queue

    offer, peek, poll

    boolean

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

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

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

  • Constructor Details

    • AbstractQueue

  • Method Details

    • add

    • remove

    • element

    • clear

    • addAll