Creates and returns a view of the given int array that requires only a small object allocation. Changes to the list will be reflected in the array up to a point. If the modification would require increasing the capacity of the array, a new array will be allocated - at which point operations will no
(int[] array, int length)
| 216 | * point of requiring the allocation of a new array |
| 217 | */ |
| 218 | public static IntList view(int[] array, int length) |
| 219 | { |
| 220 | if(length > array.length || length < 0) |
| 221 | throw new IllegalArgumentException("length must be non-negative and no more than the size of the array("+array.length+"), not " + length); |
| 222 | return new IntList(array, length); |
| 223 | } |
| 224 | } |
no outgoing calls
no test coverage detected