Collection
§ 通用api
判断
int size()
:
返回容器中元素数量
boolean isEmpty()
:
判断容器是否为空
boolean contains(Object o)
:
判断容器中是否有改元素
boolean containsAll(Collection<?> c)
:
判断是否还有传入容器中的所有元素
转化
Object[] toArray()
:
返回一个包含同样元素的数组
添加
boolean add(E e)
:
添加元素
boolean addAll(Collection<? Extends E> c)
:
添加指定容器中的所有元素到本集合中
删除
boolean remove(Object o)
:
删除对应元素
boolean removeAll(Collection<?> c)
:
删除本集合中含有的指定集合中的元素
void clear
:
清楚集合中的所有元素
boolean retainAll(<Collection<?> c>)
:
与指定集合取交集(即删除本集合中不在指定集合中的元素)
§ 继承关系