Package org.miaixz.bus.core.center.queue
Class DiscardingQueue
始终为空的队列,所有新增节点都丢弃
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.AbstractQueue
addAll, clear, element, removeMethods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Constructor Details
-
DiscardingQueue
public DiscardingQueue()
-
-
Method Details
-
getInstance
获取单例的空队列- Type Parameters:
E- 节点类型- Returns:
- DiscardingQueue
-
add
- Specified by:
addin interfaceCollection<Object>- Specified by:
addin interfaceQueue<Object>- Overrides:
addin classAbstractQueue<Object>
-
offer
-
poll
-
peek
-
size
public int size()- Specified by:
sizein interfaceCollection<Object>- Specified by:
sizein classAbstractCollection<Object>
-
iterator
- Specified by:
iteratorin interfaceCollection<Object>- Specified by:
iteratorin interfaceIterable<Object>- Specified by:
iteratorin classAbstractCollection<Object>
-