Java List Swap swap(List list, int index1, int index2)

Here you can find the source of swap(List list, int index1, int index2)

Description

swap

License

Open Source License

Declaration

public static <T> List<T> swap(List<T> list, int index1, int index2) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    public static <T> List<T> swap(List<T> list, int index1, int index2) {
        list.set(index1, list.set(index2, list.get(index1)));
        return list;
    }/* w ww  . j  a  va2s  .co  m*/
}

Related

  1. swap(List list, int i, int j)
  2. swap(List list, Object object1, Object object2)
  3. swap(List a, int i, int j)
  4. swap(List items, int index1_, int index2_)
  5. swap(List list, int i1, int i2)
  6. swap(List list, int minIndex, int maxIndex)
  7. swapElements(List list, T element1, T element2)
  8. swapItems(final List data, int from, int to)
  9. swapListElements(List list, int idx1, int idx2)