|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcynosurex.util.SortRoutines
public class SortRoutines
This class provides a variety of sort algorithms to manipulate your data.
Field Summary |
---|
Fields inherited from interface cynosurex.internal.CommonInterface |
---|
copyright, copyrightYears, notice, program, version |
Fields inherited from interface cynosurex.internal.AuthorCommon |
---|
author, copyrightSymbol, noticeMsg, rights |
Fields inherited from interface cynosurex.internal.CompanyCommon |
---|
company, email, website |
Method Summary | |
---|---|
static void |
bubbleSort(java.lang.Object[] objects,
SortFilter filter)
The Bubble Sort is always very slow, no matter what data it is sorting. |
static void |
sort(java.lang.Object[] objects,
SortFilter filter)
This method is a generic sort routine that calls another sort algorithm in this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void bubbleSort(java.lang.Object[] objects, SortFilter filter)
The Bubble Sort is always very slow, no matter what data it is sorting. However, it allocates no new memory address space, which is good for machines with low memory.
A Bubble Sort always runs in n^2 time and is a very poor choice for a sorting algorithm in any circumstance.
public static void sort(java.lang.Object[] objects, SortFilter filter)
This method is a generic sort routine that calls another sort algorithm in this class. Its purpose is to point to the best sort algorithm as they are implemented, thus saving you the headache of changing your codes.
At times, there will be no "best" algorithm, since efficiency (speed) and memory allocation (space) are inversely proportional. This method will attempt to balance the the speed and the space by picking an algorithm with a better compromise.
If your program need a strict control on the speed or space issue, call a specific sort algorithm instead.
Currently, this method calls the Bubble Sort algorithm.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |