Class SwapElement


public class SwapElement
extends Object
Convenience class for swapping elements in arrays and lists.
  • Constructor Summary

    Constructor Description
  • Method Summary

    Modifier and Type Method Description
    static void swap​(byte[] array, int a, int b)  
    static void swap​(char[] array, int a, int b)  
    static void swap​(double[] array, int a, int b)  
    static void swap​(float[] array, int a, int b)  
    static void swap​(int[] array, int a, int b)  
    static void swap​(long[] array, int a, int b)  
    static void swap​(short[] array, int a, int b)  
    static <T> void swap​(List<T> list, int a, int b)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SwapElement

      public SwapElement()
  • Method Details

    • swap

      public static void swap​(byte[] array, int a, int b)
    • swap

      public static void swap​(char[] array, int a, int b)
    • swap

      public static void swap​(short[] array, int a, int b)
    • swap

      public static void swap​(int[] array, int a, int b)
    • swap

      public static void swap​(long[] array, int a, int b)
    • swap

      public static void swap​(float[] array, int a, int b)
    • swap

      public static void swap​(double[] array, int a, int b)
    • swap

      public static <T> void swap​(List<T> list, int a, int b)