protected void exchange(String[] argv) {
		int bottom = first_nonopt;
		int middle = last_nonopt;
		int top = optind;
		String tem;

		while (top > middle && middle > bottom) {
			if (top - middle > middle - bottom) {
				// Bottom segment is the short one.
				int len = middle - bottom;
				int i;

				// Swap it with the top part of the top segment.
				for (i = 0; i < len; i++) {
					tem = argv[bottom + i];
					argv[bottom + i] = argv[top - (middle - bottom) + i];
					argv[top - (middle - bottom) + i] = tem;
				}
				// Exclude the moved bottom segment from further swapping.
				top -= len;
			} else {
				// Top segment is the short one.
				int len = top - middle;
				int i;

				// Swap it with the bottom part of the bottom segment.
				for (i = 0; i < len; i++) {
					tem = argv[bottom + i];
					argv[bottom + i] = argv[middle + i];
					argv[middle + i] = tem;
				}
				// Exclude the moved top segment from further swapping.
				bottom += len;
			}
		}

		// Update records for the slots the non-options now occupy.

		first_nonopt += (optind - last_nonopt);
		last_nonopt = optind;
	}