|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSort
public class Sort
Class Sort contains utility sort functions.
List of Methods
=================== quickSort(int[]) - quicksort a list of integers. bubbleSort(String[]) - bubble sort a list of Strings. bubbleSortIndex(String[]) - bubble sort a String[] and return sort index. bubbleSortIndex(double[]) - bubble sort a double[] and return sort index. bubbleSortIndex(float[]) - bubble sort a float[] and return sort index. bubbleSortIndex(int[]) - bubble sort a int[] and return sort index.
This code is available at the HTMLtools project on SourceForge at http://htmltools.sourceforge.org/ under the "Common Public License Version 1.0" http://www.opensource.org/licenses/cpl1.0.php.
It was derived and refactored from the open source MAExplorer (http://maexplorer.sourceforge.org/), and Open2Dprot (http://Open2Dprot.sourceforge.net/) Table modules.
$Date: 2009/067/03 11:45:56 $ $Revision: 1.28 $
Copyright 2008, 2009 by Peter Lemkin
E-Mail: lemkin@users.sourceforge.net
http://lemkingroup.com/
Constructor Summary | |
---|---|
Sort()
Sort() - Constructor |
Method Summary | |
---|---|
static java.lang.String[] |
bubbleSort(java.lang.String[] data,
int len)
bubbleSort() - Sort String array via bubble sort w/len |
static int[] |
bubbleSortIndex(double[] data,
int len,
boolean ascending)
bubbleSortIndex() - sort copy of double[0:len-1] data with bubble sort, return index[]. |
static int[] |
bubbleSortIndex(float[] data,
int len,
boolean ascending)
bubbleSortIndex() - sort copy of float[0:len-1] data with bubble sort, return index[]. |
static int[] |
bubbleSortIndex(int[] data,
int len,
boolean ascending)
bubbleSortIndex() - sort copy of int[0:len-1] data with bubble sort, return index[]. |
static int[] |
bubbleSortIndex(java.lang.String[] data,
int len,
boolean ascending)
bubbleSortIndex() - sort copy of String[0:len-1] data with bubble sort, return index[]. |
static void |
quickSort(int[] a,
int lo0,
int hi0)
quickSort() - sort the int[] array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Sort()
Method Detail |
---|
public static void quickSort(int[] a, int lo0, int hi0)
a
- array of data to sortlo0
- lower bound of arrayhi0
- uppper bound of arraypublic static java.lang.String[] bubbleSort(java.lang.String[] data, int len)
data
- array of data to be sortedlen
- size of subarray array of data to be sorted [0:len-1]
public static int[] bubbleSortIndex(java.lang.String[] data, int len, boolean ascending)
data
- array of data to be sortedlen
- size of subarray array of data to be sorted [0:len-1]ascending
- sort if true
public static int[] bubbleSortIndex(double[] data, int len, boolean ascending)
data
- array of data to be sortedlen
- size of subarray array of data to be sorted [0:len-1]ascending
- sort if true
public static int[] bubbleSortIndex(float[] data, int len, boolean ascending)
data
- array of data to be sortedlen
- size of subarray array of data to be sorted [0:len-1]ascending
- sort if true
public static int[] bubbleSortIndex(int[] data, int len, boolean ascending)
data
- array of data to be sortedlen
- size of subarray array of data to be sorted [0:len-1]ascending
- sort if true
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |