|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object comirva.util.VectorSort
public class VectorSort
This class implements special algorithms needed for sorting Float Vectors and updating their accompanying meta-data vectors.
Field Summary | |
---|---|
static int |
ASC_ORDER
|
static int |
DEC_ORDER
|
Constructor Summary | |
---|---|
VectorSort()
|
Method Summary | |
---|---|
(package private) static void |
doQuickSort(int leftBorder,
int rightBorder,
double[] sortArray,
String[] metaDataArray)
Uses Quick-Sort to sort the array sortArray and adapt the array
metaDataArray accordingly. |
static void |
doQuickSortFloat(int leftBorder,
int rightBorder,
float[] sortArray,
String[] metaDataArray,
int order)
Uses Quick-Sort to sort the array sortArray and adapt the array
metaDataArray accordingly. |
static void |
sortWithMetaData(Vector sort,
Vector metaData)
Sorts the Vector sort in decreasing order and also updates
the Vector metaData . |
static void |
sortWithMetaDataFloat(Vector<Float> sort,
Vector<String> metaData)
Sorts the Vector sort in decreasing order and also updates
the Vector metaData . |
static void |
sortWithMetaDataFloat(Vector<Float> sort,
Vector<String> metaData,
int order)
Sorts the Vector sort in ascending or decreasing order and also updates
the Vector metaData . |
static void |
sortWithMetaDataInt(Vector<Integer> sort,
Vector<String> metaData)
Sorts the Vector sort in decreasing order and also updates
the Vector metaData . |
static void |
sortWithMetaDataInt(Vector<Integer> sort,
Vector<String> metaData,
int order)
Sorts the Vector sort in ascending or decreasing order and also updates
the Vector metaData . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ASC_ORDER
public static final int DEC_ORDER
Constructor Detail |
---|
public VectorSort()
Method Detail |
---|
public static void sortWithMetaDataFloat(Vector<Float> sort, Vector<String> metaData)
sort
in decreasing order and also updates
the Vector metaData
. Each element in Vector sort
is
considered to have a meta-data element in Vector metaData
at
the same position. For example, metaData.elementAt[i]
is considered to
be a String describing the value sort.elementAt[i]
. After the sort,
the Vector sort
is sorted and the Vector metaData
is
adapted according to the new positions of the values in sort
.
sort
- a Vector containing Floats that represent a distance vectormetaData
- a Vector containing Strings that represent the meta-data to be adaptedorder
- sort in ascending or decreasing order (ASC_ORDER/DESC_ORDER)public static void sortWithMetaDataFloat(Vector<Float> sort, Vector<String> metaData, int order)
sort
in ascending or decreasing order and also updates
the Vector metaData
. Each element in Vector sort
is
considered to have a meta-data element in Vector metaData
at
the same position. For example, metaData.elementAt[i]
is considered to
be a String describing the value sort.elementAt[i]
. After the sort,
the Vector sort
is sorted and the Vector metaData
is
adapted according to the new positions of the values in sort
.
sort
- a Vector containing Floats that represent a distance vectormetaData
- a Vector containing Strings that represent the meta-data to be adaptedorder
- sort in ascending or decreasing order (ASC_ORDER/DESC_ORDER)public static void doQuickSortFloat(int leftBorder, int rightBorder, float[] sortArray, String[] metaDataArray, int order)
sortArray
and adapt the array
metaDataArray
accordingly. Sorting is performed in decreasing order.
leftBorder
- the left border for the Quick-Sort algorithmrightBorder
- the right border for the Quick-Sort algorithmsortArray
- a float[] representing the values to be sortedmetaDataArray
- a String[] representing the meta-data to be updated according to new order after the sortorder
- sort in ascending or decreasing order (ASC_ORDER/DESC_ORDER)public static void sortWithMetaDataInt(Vector<Integer> sort, Vector<String> metaData)
sort
in decreasing order and also updates
the Vector metaData
. Each element in Vector sort
is
considered to have a meta-data element in Vector metaData
at
the same position. For example, metaData.elementAt[i]
is considered to
be a String describing the value sort.elementAt[i]
. After the sort,
the Vector sort
is sorted and the Vector metaData
is
adapted according to the new positions of the values in sort
.
sort
- a Vector containing Floats that represent a distance vectormetaData
- a Vector containing Strings that represent the meta-data to be adaptedorder
- sort in ascending or decreasing order (ASC_ORDER/DESC_ORDER)public static void sortWithMetaDataInt(Vector<Integer> sort, Vector<String> metaData, int order)
sort
in ascending or decreasing order and also updates
the Vector metaData
. Each element in Vector sort
is
considered to have a meta-data element in Vector metaData
at
the same position. For example, metaData.elementAt[i]
is considered to
be a String describing the value sort.elementAt[i]
. After the sort,
the Vector sort
is sorted and the Vector metaData
is
adapted according to the new positions of the values in sort
.
sort
- a Vector containing Integers that represent a distance vectormetaData
- a Vector containing Strings that represent the meta-data to be adaptedorder
- sort in ascending or decreasing order (ASC_ORDER/DESC_ORDER)public static void sortWithMetaData(Vector sort, Vector metaData)
sort
in decreasing order and also updates
the Vector metaData
. Each element in Vector sort
is
considered to have a meta-data element in Vector metaData
at
the same position. For example, metaData.elementAt[i]
is considered to
be a String describing the value sort.elementAt[i]
. After the sort,
the Vector sort
is sorted and the Vector metaData
is
adapted according to the new positions of the values in sort
.
sort
- a Vector containing Doubles that represent a distance vectormetaData
- a Vector containing Strings that represent the meta-data to be adaptedstatic void doQuickSort(int leftBorder, int rightBorder, double[] sortArray, String[] metaDataArray)
sortArray
and adapt the array
metaDataArray
accordingly. Sorting is performed in decreasing order.
leftBorder
- the left border for the Quick-Sort algorithmrightBorder
- the right border for the Quick-Sort algorithmsortArray
- a double[] representing the values to be sortedmetaDataArray
- a String[] representing the meta-data to be updated according to new order after the sort
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |