public class FloatArray
extends java.lang.Object
构造器和说明 |
---|
FloatArray()
Creates an ordered array with a capacity of 16.
|
FloatArray(boolean ordered,
float[] array,
int startIndex,
int count)
Creates a new array containing the elements in the specified array.
|
FloatArray(boolean ordered,
int capacity) |
FloatArray(float[] array)
Creates a new ordered array containing the elements in the specified array.
|
FloatArray(FloatArray array)
Creates a new array containing the elements in the specific array.
|
FloatArray(int capacity)
Creates an ordered array with the specified capacity.
|
限定符和类型 | 方法和说明 |
---|---|
void |
add(float value) |
void |
addAll(float... array) |
void |
addAll(float[] array,
int offset,
int length) |
void |
addAll(FloatArray array) |
void |
addAll(FloatArray array,
int offset,
int length) |
void |
clear() |
boolean |
contains(float value) |
float[] |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to accommodate the specified number of additional items.
|
boolean |
equals(java.lang.Object object) |
boolean |
equals(java.lang.Object object,
float epsilon) |
float |
first()
Returns the first item.
|
float |
get(int index) |
int |
hashCode() |
void |
incr(int index,
float value) |
int |
indexOf(float value) |
void |
insert(int index,
float value) |
int |
lastIndexOf(char value) |
void |
mul(int index,
float value) |
float |
peek()
Returns the last item.
|
float |
pop()
Removes and returns the last item.
|
float |
random()
Returns a random item from the array, or zero if the array is empty.
|
boolean |
removeAll(FloatArray array)
Removes from this array all of elements contained in the specified array.
|
float |
removeIndex(int index)
Removes and returns the item at the specified index.
|
void |
removeRange(int start,
int end)
Removes the items between the specified indices, inclusive.
|
boolean |
removeValue(float value) |
protected float[] |
resize(int newSize) |
void |
reverse() |
void |
set(int index,
float value) |
float[] |
setSize(int newSize)
Sets the array size, leaving any values beyond the current size undefined.
|
float[] |
shrink()
Reduces the size of the backing array to the size of the actual items.
|
void |
shuffle() |
void |
sort() |
void |
swap(int first,
int second) |
float[] |
toArray() |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String separator) |
void |
truncate(int newSize)
Reduces the size of the array to the specified size.
|
static FloatArray |
with(float... array) |
public FloatArray()
public FloatArray(int capacity)
public FloatArray(boolean ordered, int capacity)
ordered
- If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy.capacity
- Any elements added beyond this will cause the backing array to be grown.public FloatArray(FloatArray array)
public FloatArray(float[] array)
public FloatArray(boolean ordered, float[] array, int startIndex, int count)
ordered
- If false, methods that remove elements may change the order of other elements in the array, which avoids a
memory copy.public void add(float value)
public void addAll(FloatArray array)
public void addAll(FloatArray array, int offset, int length)
public void addAll(float... array)
public void addAll(float[] array, int offset, int length)
public float get(int index)
public void set(int index, float value)
public void incr(int index, float value)
public void mul(int index, float value)
public void insert(int index, float value)
public void swap(int first, int second)
public boolean contains(float value)
public int indexOf(float value)
public int lastIndexOf(char value)
public boolean removeValue(float value)
public float removeIndex(int index)
public void removeRange(int start, int end)
public boolean removeAll(FloatArray array)
public float pop()
public float peek()
public float first()
public void clear()
public float[] shrink()
items
public float[] ensureCapacity(int additionalCapacity)
items
public float[] setSize(int newSize)
items
protected float[] resize(int newSize)
public void sort()
public void reverse()
public void shuffle()
public void truncate(int newSize)
public float random()
public float[] toArray()
public int hashCode()
hashCode
在类中 java.lang.Object
public boolean equals(java.lang.Object object)
equals
在类中 java.lang.Object
public boolean equals(java.lang.Object object, float epsilon)
public java.lang.String toString()
toString
在类中 java.lang.Object
public java.lang.String toString(java.lang.String separator)
public static FloatArray with(float... array)
FloatArray(float[])