public class DiscardingQueue extends AbstractQueue<Object>
| Constructor and Description |
|---|
DiscardingQueue() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object e) |
static <E> Queue<E> |
getInstance()
获取单例的空队列
|
Iterator<Object> |
iterator() |
boolean |
offer(Object e) |
Object |
peek() |
Object |
poll() |
int |
size() |
addAll, clear, element, removecontains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArraypublic static <E> Queue<E> getInstance()
E - 节点类型public boolean add(Object e)
add in interface Collection<Object>add in interface Queue<Object>add in class AbstractQueue<Object>public boolean offer(Object e)
public Object poll()
public Object peek()
public int size()
size in interface Collection<Object>size in class AbstractCollection<Object>Copyright © 2025. All rights reserved.