Skip to content

Tag Archives: java-DelayQueue

The DelayQueue class belongs to java.util.concurrent package. DelayQueue implements the BlockingQueue interface. DelayQueue is a specialized Priority Queue that orders elements supported their delay time.… Read More
The remainingCapacity() method of DelayQueue always returns Integer.MAX_VALUE because a DelayQueue is not capacity constrained. That means, irrespective of the size of the DelayQueue it… Read More
The drainTo(Collection<E> c) method of DelayQueue removes all available elements from this DelayQueue and adds them to the given collection passed as a parameter. This… Read More
The toArray() method of DelayQueue is used to return an array containing all the elements in DelayQueue. There elements are not in any specific order… Read More
The take() method of DelayQueue is used to retrieve head of the DelayQueue and also removes it. Thus, the size of the DelayQueue is reduced.… Read More
The iterator() method of DelayQueue is used to return an iterator over all the elements in the DelayQueue. These elements can be expired or unexpired.Syntax:  … Read More
The peek() method of DelayQueue is used to retrieve head of the DelayQueue, but does not remove it, as in case of poll() method where… Read More
The poll() method of DelayQueue is used to retrieve head of the DelayQueue. This method also removes the head from the DelayQueue. Thus when poll… Read More
The offer() method of DelayQueue is used to insert specified element in the delay queue. It acts similar to add() method of DelayQueue.Syntax:   public boolean… Read More
The size() method of DelayQueue class in Java is used to return the number of elements present in the given queue. If the number of… Read More
The remove() method of DelayQueue class in Java is used to remove a single instance of the given object say obj from this DelayQueue if… Read More
The put(E ele) method of DelayQueue class in Java is used to inserts a given element into the delay queue container. Hetre, E is the… Read More
The add(E ele) method of DelayQueue class in Java is used to insert the given element into the delay queue and returns true if the… Read More
The clear() method of DelayQueue in Java is used to remove all of the elements in the current DelayQueue object. The queue will be empty… Read More
The DelayQueue class is a member of the Java Collections Framework. It belongs to java.util.concurrent package. DelayQueue implements the BlockingQueue interface. DelayQueue is a specialized… Read More

Start Your Coding Journey Now!