Lines Matching defs:distance
746 * Rotates the elements in the specified list by the specified distance.
748 * the element previously at index <tt>(i - distance)</tt> mod
775 * of the rotation distance. To move elements backward, use a positive
776 * shift distance.
786 * list into two sublist views around index <tt>-distance mod size</tt>.
793 * @param distance the distance to rotate the list. There are no
800 public static void rotate(List<?> list, int distance) {
802 rotate1(list, distance);
804 rotate2(list, distance);
807 private static <T> void rotate1(List<T> list, int distance) {
811 distance = distance % size;
812 if (distance < 0)
813 distance += size;
814 if (distance == 0)
821 i += distance;
830 private static void rotate2(List<?> list, int distance) {
834 int mid = -distance % size;