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, remove
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
public 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.