()
| 337 | public abstract int size(); |
| 338 | |
| 339 | public Object[] toArray() { |
| 340 | int size = size(), index = 0; |
| 341 | Iterator<?> it = iterator(); |
| 342 | Object[] array = new Object[size]; |
| 343 | while (index < size) { |
| 344 | array[index++] = it.next(); |
| 345 | } |
| 346 | return array; |
| 347 | } |
| 348 | |
| 349 | @SuppressWarnings("unchecked") |
| 350 | public <T> T[] toArray(T[] contents) { |