Set the entry at a particular index. @webref floatlist:method @webBrief Set the entry at a particular index
(int index, float what)
| 164 | * @webBrief Set the entry at a particular index |
| 165 | */ |
| 166 | public void set(int index, float what) { |
| 167 | if (index >= count) { |
| 168 | data = PApplet.expand(data, index+1); |
| 169 | for (int i = count; i < index; i++) { |
| 170 | data[i] = 0; |
| 171 | } |
| 172 | count = index+1; |
| 173 | } |
| 174 | data[index] = what; |
| 175 | } |
| 176 | |
| 177 | |
| 178 | /** Just an alias for append(), but matches pop() */ |
no test coverage detected