org.exist.util
Class SwapVals

java.lang.Object
  extended by org.exist.util.SwapVals

public final class SwapVals
extends Object

This class only contains static methods which help when the values of two positions in a array or list-like structure must be swapped. Based on previous implementations found in eXist FastQSort original code and internet


Constructor Summary
SwapVals()
           
 
Method Summary
static void swap(int[] a, int i, int j)
           
static
<C> void
swap(List<C> a, int i, int j)
           
static void swap(long[] a, int i, int j)
           
static void swap(Object[] a, int i, int j)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwapVals

public SwapVals()
Method Detail

swap

public static final void swap(long[] a,
                              int i,
                              int j)

swap

public static final void swap(int[] a,
                              int i,
                              int j)

swap

public static final void swap(Object[] a,
                              int i,
                              int j)

swap

public static final <C> void swap(List<C> a,
                                  int i,
                                  int j)


Copyright (C) Wolfgang Meier. All rights reserved.