public abstract class SortAlgorithm
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList |
indexList
If the new positions of the unsorted elements are stored, then save that here.
|
| Constructor and Description |
|---|
SortAlgorithm()
Create a new instance of SelectionSort
|
| Modifier and Type | Method and Description |
|---|---|
java.util.ArrayList |
getIndexList()
Get the list of new index positions if used.
|
static java.util.ArrayList |
randomise(java.util.ArrayList sortList)
Randomise the ordering in the sort list.
|
abstract java.util.ArrayList |
sort(java.lang.String valueType,
EvaluateMathDef eval,
java.util.ArrayList sortList,
boolean sortIndexes)
Run the sort over all the elements in the array.
|
protected java.util.ArrayList indexList
public abstract java.util.ArrayList sort(java.lang.String valueType,
EvaluateMathDef eval,
java.util.ArrayList sortList,
boolean sortIndexes)
throws java.lang.Exception
valueType - the object type being evaluated.eval - the evaluation function.sortList - the array of values to sort.sortIndexes - if true also record the new index positions from their original position.
If false do not do this, as it requires extra processing steps.java.lang.Exception - any error.public java.util.ArrayList getIndexList()
public static java.util.ArrayList randomise(java.util.ArrayList sortList)
sortList - the list of values. This is then randomised, where the changed order
is placed in this same list object.