| 构造器和说明 |
|---|
FloatArrayList()
构建一个空的列表.
|
FloatArrayList(int initialCapacity)
指定容量的方式构建一个IntList.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
add(float e)
Appends the specified element to the end of this list.
|
boolean |
addAll(float[] a)
Appends all of the elements in the specified collection to the end of
this list, in the order that they are returned by the specified
collection's Iterator.
|
void |
clear()
Removes all of the elements from this list.
|
boolean |
contains(float o)
Returns true if this list contains the specified element.
|
boolean |
equals(java.lang.Object obj) |
float |
get(int index)
Returns the element at the specified position in this list.
|
int |
hashCode() |
int |
indexOf(float x)
返回此列表中第一次出现的指定元素的索引.
|
boolean |
isEmpty()
Returns true if this list contains no elements.
|
int |
lastIndexOf(float x)
返回此列表中最后出现的指定元素的索引.
|
float |
random()
从列表中随机出一个元素.
|
boolean |
remove(float o)
Removes the first occurrence of the specified element from this list, if
it is present.
|
int |
size()
Returns the number of elements in this list.
|
float[] |
toArray()
Returns an array containing all of the elements in this list in proper
sequence (from first to last element).
|
void |
trimToSize()
将此IntArrayList实例的容量调整为列表的当前大小。
|
public FloatArrayList()
public FloatArrayList(int initialCapacity)
initialCapacity - 初始容量public void trimToSize()
应用程序可以使用此操作来最小化 IntArrayList实例的存储量。
public int size()
public boolean isEmpty()
public boolean contains(float o)
public int indexOf(float x)
如果列表不包含此元素,则返回 -1。
更确切地讲,返回满足 (get(i)==x) 的最高索引 i;
如果没有这样的索引,则返回 -1。
x - 要搜索的元素public int lastIndexOf(float x)
如果列表不包含此元素,则返回 -1。
更确切地讲,返回满足 (get(i)==x) 的最高索引 i;
如果没有这样的索引,则返回 -1。
x - 要搜索的元素public float[] toArray()
The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array). The caller is thus free to modify the returned array.
This method acts as bridge between array-based and collection-based APIs.
public float get(int index)
public boolean add(float e)
public boolean remove(float o)
public void clear()
public boolean addAll(float[] a)
a - collection containing elements to be added to this listjava.lang.NullPointerException - if the specified collection is nullpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals 在类中 java.lang.Object