Inherited by sorting.BubbleSort, sorting.InsertionSort, and sorting.SelectionSort.
Inheritance diagram for sorting.Sort:
Public Member Functions | |
void | run () |
This function is automatically executet when starting the thread. | |
int[] | getSortedArray () |
This function returns the integer array theArray. | |
void | showArray () |
This function is used to visualize the integer numbers of the integer array by painting the numbers as vertical green lines. | |
void | setSettings (int[] aArray, Panel aPanel, Label aLabel) |
This function is used to set the attributes theArray, thePanel and theLabel. | |
Protected Member Functions | |
void | doSort () |
This is just a empty sorting function to be overloaded by child classes. | |
void | exchange (int[] aArray, int index1, int index2) |
This function changes the positions of two array elements. | |
long | calcRuntime () |
This function calculates the runtime of the thread. | |
Protected Attributes | |
long | startTime = 0 |
long | endTime = 0 |
long | runTime = 0 |
int[] | theArray |
Panel | thePanel |
Label | theLabel |
This class provides some functions and attributes, which are used by all child classes. For example, each sorting algorithm in this package uses a exchange() function to change the positions of two array elements. So this function is implemented once in this super class and then inherited to each child class. But this super class provides only an empty sorting function - this function must be overloaded by child classes with different sorting algorithms (therefore it makes no sense to create instances of this super class and therfore this is an abstract class).
Definition at line 26 of file Sort.java.
|
This function calculates the runtime of the thread.
Definition at line 91 of file Sort.java. References sorting.Sort.startTime. Referenced by sorting.SelectionSort.doSort(), sorting.InsertionSort.doSort(), sorting.BubbleSort.doSort(), and sorting.Sort.run(). |
|
This is just a empty sorting function to be overloaded by child classes. Child classes overload this function with own doSort() functions and different algorithms. Reimplemented in sorting.BubbleSort, sorting.InsertionSort, and sorting.SelectionSort. Definition at line 67 of file Sort.java. Referenced by sorting.Sort.run(). |
|
This function changes the positions of two array elements.
|
|
This function returns the integer array theArray. This function is used to get access to the sortet integer numbers.
|
|
This function is automatically executet when starting the thread. The run() function calls the doSort() function, which is overloaded by child classes. Definition at line 41 of file Sort.java. References sorting.Sort.calcRuntime(), and sorting.Sort.doSort(). Here is the call graph for this function: |
|
This function is used to set the attributes theArray, thePanel and theLabel.
Definition at line 123 of file Sort.java. Referenced by DoxygenExample.sortArrays(), DoxygenExample.startBubbleSort(), DoxygenExample.startInsertionSort(), and DoxygenExample.startSelectionSort(). |
|
This function is used to visualize the integer numbers of the integer array by painting the numbers as vertical green lines.
Definition at line 101 of file Sort.java. References sorting.Sort.theArray, and sorting.Sort.thePanel. |
|
|
|
|
|
Definition at line 28 of file Sort.java. Referenced by sorting.Sort.calcRuntime(). |
|
Definition at line 32 of file Sort.java. Referenced by sorting.SelectionSort.doSort(), sorting.InsertionSort.doSort(), sorting.BubbleSort.doSort(), and sorting.Sort.showArray(). |
|
|
|
Definition at line 33 of file Sort.java. Referenced by sorting.Sort.showArray(). |