Removes the items between the specified indices, inclusive.
(int start, int end)
| 323 | |
| 324 | /** Removes the items between the specified indices, inclusive. */ |
| 325 | public void removeRange (int start, int end) { |
| 326 | int n = size; |
| 327 | validateRange(start, end); |
| 328 | int count = end - start + 1, lastIndex = n - count; |
| 329 | if (ordered) |
| 330 | System.arraycopy(items, start + count, items, start, n - (start + count)); |
| 331 | else { |
| 332 | int i = Math.max(lastIndex, end + 1); |
| 333 | System.arraycopy(items, i, items, start, n - i); |
| 334 | } |
| 335 | size = n - count; |
| 336 | } |
| 337 | |
| 338 | /** Removes from this array the first instance of each element contained in the specified array. |
| 339 | * @return true if this array was modified. */ |