public class FloatArray
extends java.lang.Object
| Constructor and Description |
|---|
FloatArray()
Creates a new expandable array with an initial capacity of 100.
|
FloatArray(int initialCapacity)
Creates a new expandable array with specified initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
int |
add(float value)
Appends the specified value to the end of this expandable array.
|
float |
get(int index)
Returns the element at the specified position in this expandable array.
|
float |
set(int index,
float value)
Replaces the element at the specified position with the value.
|
int |
size()
Returns the number of elements in the array.
|
float[] |
toArray()
Returns a float array containing all elements of this expandable array.
|
void |
trimToSize()
Trims the capacity of this FloatArray instance to be its current size,
minimizing the storage of the FloatArray instance.
|
public FloatArray()
public FloatArray(int initialCapacity)
java.lang.IllegalArgumentException - if the specified initial capacity is less than zeropublic int size()
public float[] toArray()
public float get(int index)
java.lang.IndexOutOfBoundsException - - if index is out of range (index < 0 || index >= size()).public float set(int index,
float value)
- - if index is out of range (index < 0 || index >= size()).public int add(float value)
public void trimToSize()