| 构造器和说明 |
|---|
FastCopyOnWriteArrayList() |
FastCopyOnWriteArrayList(Class<T> type) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
add(int index,
T obj)
指定位置添加一个元素,如果刚好等于集合长度,在最后添加。
|
boolean |
add(T obj)
在尾部添加元素
|
boolean |
addFirst(T obj)
添加到数组首位
|
boolean |
addLast(T obj)
添加最后
|
T[] |
arrays() |
boolean |
checkIndexOut(int index)
判断给定索引是否越界
|
void |
clear()
删除所有元素
|
boolean |
contain(T obj)
查看集合中是否包含某个元素,如果有,返回 true,没有返回 false
|
T |
get(int index)
根据索引获得元素
|
T |
getFirst()
获取第一个
|
T |
getLast()
获取最后一个
|
int |
indexOf(T o)
根据元素获得在集合中的索引
|
Iterator<T> |
iterator() |
T |
remove(int index)
根据索引删除元素
|
boolean |
remove(T obj)
删除指定的元素,删除成功返回 true,失败返回 false
|
T |
round()
轮训,均衡的随机获取数组里面的元素
|
T |
set(int index,
T obj)
在指定位置修改元素,通过索引,修改完成后返回原数据
|
void |
setArray(T[] arr) |
int |
size()
获取数组的大小
|
T[] |
toArray() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic int size()
public int indexOf(T o)
o - opublic boolean add(T obj)
obj - objpublic boolean addFirst(T obj)
obj - public boolean addLast(T obj)
obj - public boolean add(int index,
T obj)
index - obj - public boolean checkIndexOut(int index)
index - indexpublic T get(int index)
index - indexpublic T getFirst()
public T getLast()
public void clear()
public T remove(int index)
index - indexpublic boolean remove(T obj)
obj - objpublic boolean contain(T obj)
obj - objpublic T[] arrays()
public void setArray(T[] arr)
public T[] toArray()
public T round()
Copyright © 2021. All rights reserved.