E
- 元素类型public class BoundedList<E> extends ListWrapper<E> implements BoundedCollection<E>
raw
Constructor and Description |
---|
BoundedList(int maxSize)
构造
|
BoundedList(List<E> raw,
int maxSize)
构造,限制集合的最大容量为提供的List
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
void |
add(int index,
E element) |
boolean |
addAll(Collection<? extends E> c) |
boolean |
addAll(int index,
Collection<? extends E> c) |
boolean |
isFull()
是否已满,如果集合已满,不允许新增元素
|
int |
maxSize()
获取集合最大允许容量
|
clear, contains, containsAll, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, parallelStream, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, stream, subList, toArray, toArray
getRaw
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
public boolean isFull()
BoundedCollection
isFull
in interface BoundedCollection<E>
public int maxSize()
BoundedCollection
maxSize
in interface BoundedCollection<E>
public boolean add(E e)
add
in interface Collection<E>
add
in interface List<E>
add
in class ListWrapper<E>
public void add(int index, E element)
public boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
addAll
in interface List<E>
addAll
in class ListWrapper<E>
public boolean addAll(int index, Collection<? extends E> c)
Copyright © 2025. All rights reserved.