Return an integer array containing consecutive integers from a given start value upto (but not including) a given end value. @param start The start value from which the range begins. This value is always the first element of the final array (assuming it's not empty)
(int start, int end)
| 36 | * @return |
| 37 | */ |
| 38 | public static int[] range(int start, int end) { |
| 39 | if (end <= start) { |
| 40 | return new int[0]; |
| 41 | } else { |
| 42 | int[] rs = new int[Math.abs(end - start)]; |
| 43 | for (int i = start; i < end; ++i) { |
| 44 | rs[i - start] = i; |
| 45 | } |
| 46 | return rs; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Append two arrays of boolean type together, producing a fresh array whose |