dcsimg

How can I easily shift the elements in a List / Vector such that all the elements rotate n elements?

John Zukowski

The Java 1.4 API adds a rotate() method to the Collections class: rotate(List list, int distance) that will shift the elements for you.