java.lang.Object
cn.wjybxx.base.collection.BoundedArrayDeque<E>
- 所有已实现的接口:
Iterable<E>,Collection<E>,Deque<E>,Queue<E>,SequencedCollection<E>
滑动式双端队列
1.当达到容量限制时,将自动移除另一端的元素。
2.不支持插入null元素
3.使用代理的方式实现,避免JDK新增接口忘记处理。
- 作者:
- wjybxx date 2023/12/1
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanbooleanaddAll(Collection<? extends E> c) voidvoidvoidclear()booleanbooleancontainsAll(Collection<?> c) element()voidgetFirst()getLast()booleanisEmpty()iterator()booleanbooleanofferFirst(E e) booleanpeek()peekLast()poll()pollLast()pop()voidremove()booleanbooleanremoveAll(Collection<?> c) booleanbooleanbooleanbooleanretainAll(Collection<?> c) voidsetCapacity(int capacity, DequeOverflowBehavior overflowBehavior) intsize()stream()Object[]toArray()<T> T[]toArray(IntFunction<T[]> generator) <T> T[]toArray(T[] a) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 java.util.Collection
equals, hashCode
-
构造器详细资料
-
BoundedArrayDeque
-
-
方法详细资料
-
setCapacity
- 参数:
capacity- 新的容量overflowBehavior- 容量缩小时的策略,不会保存
-
offer
-
remove
-
poll
-
element
-
peek
-
add
- 指定者:
add在接口中Collection<E>- 指定者:
add在接口中Deque<E>- 指定者:
add在接口中Queue<E>- 抛出:
IllegalStateException- 队列已满
-
addAll
- 指定者:
addAll在接口中Collection<E>- 指定者:
addAll在接口中Deque<E>- 抛出:
IllegalStateException- 队列已满
-
addFirst
- 指定者:
addFirst在接口中Deque<E>- 指定者:
addFirst在接口中SequencedCollection<E>- 抛出:
IllegalStateException- 队列已满
-
addLast
- 指定者:
addLast在接口中Deque<E>- 指定者:
addLast在接口中SequencedCollection<E>- 抛出:
IllegalStateException- 队列已满
-
offerFirst
- 指定者:
offerFirst在接口中Deque<E>
-
offerLast
-
getFirst
-
peekFirst
-
removeFirst
- 指定者:
removeFirst在接口中Deque<E>- 指定者:
removeFirst在接口中SequencedCollection<E>
-
pollFirst
-
getLast
-
peekLast
-
removeLast
- 指定者:
removeLast在接口中Deque<E>- 指定者:
removeLast在接口中SequencedCollection<E>
-
pollLast
-
push
-
pop
-
size
public int size() -
isEmpty
public boolean isEmpty()- 指定者:
isEmpty在接口中Collection<E>
-
clear
public void clear()- 指定者:
clear在接口中Collection<E>
-
contains
-
remove
-
removeFirstOccurrence
- 指定者:
removeFirstOccurrence在接口中Deque<E>
-
removeLastOccurrence
- 指定者:
removeLastOccurrence在接口中Deque<E>
-
removeIf
- 指定者:
removeIf在接口中Collection<E>
-
containsAll
- 指定者:
containsAll在接口中Collection<E>
-
removeAll
- 指定者:
removeAll在接口中Collection<E>
-
retainAll
- 指定者:
retainAll在接口中Collection<E>
-
iterator
-
descendingIterator
- 指定者:
descendingIterator在接口中Deque<E>
-
spliterator
- 指定者:
spliterator在接口中Collection<E>- 指定者:
spliterator在接口中Iterable<E>
-
forEach
-
toArray
- 指定者:
toArray在接口中Collection<E>
-
toArray
@Nonnull public <T> T[] toArray(T[] a) - 指定者:
toArray在接口中Collection<E>
-
toArray
- 指定者:
toArray在接口中Collection<E>
-
stream
- 指定者:
stream在接口中Collection<E>
-
parallelStream
- 指定者:
parallelStream在接口中Collection<E>
-