Appends the specified value to the end of this FloatArray. Returns the number of elements after adding.
(float value)
| 63 | |
| 64 | /** Appends the specified value to the end of this FloatArray. Returns the number of elements after adding. */ |
| 65 | public int add(float value) { |
| 66 | if (size >= data.length) { |
| 67 | float[] newData = new float[size*2 + 50]; |
| 68 | System.arraycopy(data, 0, newData, 0, size); |
| 69 | data = newData; |
| 70 | } |
| 71 | data[size++] = value; |
| 72 | return size; |
| 73 | } |
| 74 | |
| 75 | /** Appends the first n values from the specified array to this FloatArray. Returns the number of elements after adding. */ |
| 76 | public int add(float[] a, int n) { |
no test coverage detected