Copies object from one array to another array with reverse of objects order. Source and destination arrays may be the same. @param src - the source array. @param from - starting position in the source array. @param dst - the destination array. @param to -
(Object[] src, int from, Object[] dst, int to,
int len)
| 2918 | * the number of array elements to be copied. |
| 2919 | */ |
| 2920 | private static void copySwap(Object[] src, int from, Object[] dst, int to, |
| 2921 | int len) { |
| 2922 | if (src == dst && from + len > to) { |
| 2923 | int new_to = to + len - 1; |
| 2924 | for (; from < to; from++, new_to--, len--) { |
| 2925 | dst[new_to] = src[from]; |
| 2926 | } |
| 2927 | for (; len > 1; from++, new_to--, len -= 2) { |
| 2928 | swap(from, new_to, dst); |
| 2929 | } |
| 2930 | |
| 2931 | } else { |
| 2932 | to = to + len - 1; |
| 2933 | for (; len > 0; from++, to--, len--) { |
| 2934 | dst[to] = src[from]; |
| 2935 | } |
| 2936 | } |
| 2937 | } |
| 2938 | |
| 2939 | /** |
| 2940 | * Performs a sort on the given String array. Elements will be re-ordered into |