Beispiel #1
0
 private void move(int index, int upOrDown) {
   List<P> positions = getPositions();
   P move = positions.get(index);
   P replace = positions.get(index + upOrDown);
   positions.set(index + upOrDown, move);
   positions.set(index, replace);
 }
Beispiel #2
0
 public void order(List<P> positions) {
   List<P> existing = getPositions();
   for (int i = 0; i < positions.size(); i++) {
     existing.set(i, positions.get(i));
   }
 }