Queue (Java SE 25 & JDK 25)
- 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
booleanInserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning
trueupon success and throwing anIllegalStateExceptionif no space is currently available.element()Retrieves, but does not remove, the head of this queue.
booleanInserts 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
nullif this queue is empty.poll()Retrieves and removes the head of this queue, or returns
nullif 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
-
Method Details
-
add
-
offer
-
remove
-
poll
-
element
-
peek
-