public void swap ( int i , int j ) { checkBounds ( i ) ; checkBounds ( j ) ; if ( i == j ) return ; copier . copy ( tmp , offset ( i ) ) ; unsafe . copyMemory ( null , offset ( j ) , null , offset ( i ) , elementSpacing ) ; unsafe . copyMemory ( tmp , firstFieldOffset , null , offset ( j ) , elementSize ) ; }
Swaps two elements