Java List Swap swap(List a, int i, int j)

Here you can find the source of swap(List a, int i, int j)

  1. HOME
  2. Java
  3. L
  4. List Swap
  5. swap(List a, int i, int j)

Description

swap

License

Open Source License

Declaration

private static <A> void swap(List<A> a, int i, int j) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    private static <A> void swap(List<A> a, int i, int j) {
        final A tmp = a.get(i);
        a.set(i, a.get(j));//  w ww  . j a  v a 2s . c o  m
        a.set(j, tmp);
    }
}

Related

  1. swap(final List list, final int index0, final int index1)
  2. swap(final List list, final int index1, final int index2)
  3. swap(final List list, int i1, int i2)
  4. swap(List list, int i, int j)
  5. swap(List list, Object object1, Object object2)
  6. swap(List items, int index1_, int index2_)
  7. swap(List list, int i1, int i2)
  8. swap(List list, int index1, int index2)
  9. swap(List list, int minIndex, int maxIndex)

HOME | Copyright © www.java2s.com 2016