Appends an element to the end of this array, growing the backing storage when needed. @param o the element to append
(Object o)
| 93 | * @param o the element to append |
| 94 | */ |
| 95 | public void add(Object o) { |
| 96 | if (size == data.length) { |
| 97 | Object [] newData = new Object[size == 0 ? 8 : size*2]; |
| 98 | System.arraycopy(data, 0, newData, 0, size); |
| 99 | data = newData; |
| 100 | } |
| 101 | data [size++] = o; |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Replaces the element stored at the specified index. |
no test coverage detected