com.jme3.util
クラス SortUtil

java.lang.Object
  上位を拡張 com.jme3.util.SortUtil

public class SortUtil
extends java.lang.Object

Quick and merge sort implementations that create no garbage, unlike Arrays.sort(long[]). The merge sort is stable, the quick sort is not.


コンストラクタの概要
SortUtil()
           
 
メソッドの概要
static void gsort(java.lang.Object[] a, java.util.Comparator comp)
          procedure optimizedGnomeSort(a[]) pos := 1 last := 0 while pos < length(a) if (a[pos] >= a[pos-1]) if (last !
static void main(java.lang.String[] args)
           
static void msort(java.lang.Object[] src, java.lang.Object[] dest, java.util.Comparator comp)
          Merge sort
static void msort(java.lang.Object[] src, java.lang.Object[] dest, int low, int high, java.util.Comparator comp)
          Merge sort
static void qsort(int[] a, int lo0, int hi0, java.util.Comparator comp)
           
static void qsort(java.lang.Object[] a, java.util.Comparator comp)
          Quick sorts the supplied array using the specified comparator.
static void qsort(java.lang.Object[] a, int lo0, int hi0, java.util.Comparator comp)
          Quick sorts the supplied array using the specified comparator.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

SortUtil

public SortUtil()
メソッドの詳細

gsort

public static void gsort(java.lang.Object[] a,
                         java.util.Comparator comp)
procedure optimizedGnomeSort(a[]) pos := 1 last := 0 while pos < length(a) if (a[pos] >= a[pos-1]) if (last != 0) pos := last last := 0 end if pos := pos + 1 else swap a[pos] and a[pos-1] if (pos > 1) if (last == 0) last := pos end if pos := pos - 1 else pos := pos + 1 end if end if end while end procedure


main

public static void main(java.lang.String[] args)

qsort

public static void qsort(java.lang.Object[] a,
                         java.util.Comparator comp)
Quick sorts the supplied array using the specified comparator.


qsort

public static void qsort(java.lang.Object[] a,
                         int lo0,
                         int hi0,
                         java.util.Comparator comp)
Quick sorts the supplied array using the specified comparator.

パラメータ:
lo0 - the index of the lowest element to include in the sort.
hi0 - the index of the highest element to include in the sort.

qsort

public static void qsort(int[] a,
                         int lo0,
                         int hi0,
                         java.util.Comparator comp)

msort

public static void msort(java.lang.Object[] src,
                         java.lang.Object[] dest,
                         java.util.Comparator comp)
Merge sort


msort

public static void msort(java.lang.Object[] src,
                         java.lang.Object[] dest,
                         int low,
                         int high,
                         java.util.Comparator comp)
Merge sort

パラメータ:
src - Source array
dest - Destination array
low - Index of beginning element
high - Index of end element
comp - Comparator