AbstractColletion implements Collection
他的意义:
他实现了interface Colletion接口,对Collection接口的通用方法给出了实现,集合开发者可以直接继承自这个类就少了很多对通用方法实现了.
具体实现了以下通用方法:
1.public abstract Iterator iterator();抽象
2.public boolean add(E object) {
throw new UnsupportedOperationException();
}
3.public boolean addAll(Collection collection);
4.public boolean remove(Object object);equls
5.public boolean removeAll(Collection collection);
6.public boolean retainAll(Collection collection);
7.public void clear();
8.public boolean contains(Object object);
9.public boolean containsAll(Collection collection);
10.public Object[] toArray();把集合的值返回一个Object数组
11.public T[] toArray(T[] arrayToFill);
12.public boolean isEmpty();
13.public abstract int size();抽象
14.public int hashCode();返回集合对象hash值,一个int类型的数值
网友评论