| java.lang.Object com.adventnet.jmx.utils.Sorter
Sorter | public class Sorter implements java.io.Serializable(Code) | | This is a utility class which sorts a objectID array using
quick sort mechanism .By default the compareTo method compares
two strings str1 & str2 considering it to be a OID string. API
users may override this method inorder to have their own compareTo
method incase of different type of string.
Usage is :
sorter = new Sorter();
toSort = new String[2]{".1.3.6.1.3.2", ".1.3.6.1.3.12",};
sorter.sort(toSort, null);
|
Method Summary | |
public void | QuickSort(String a, int lo0, int hi0) This is a generic version of C.A.R Hoare's Quick Sort
algorithm. | public void | QuickSort(int a, int lo0, int hi0) This is a generic version of C.A.R Hoare's Quick Sort
algorithm. | public void | sort(String a, Object[][] obj) This method sorts the OID string array in ascending order. | public void | sort(int a) |
QuickSort | public void QuickSort(String a, int lo0, int hi0) throws Exception(Code) | | This is a generic version of C.A.R Hoare's Quick Sort
algorithm. This will handle arrays that are already
sorted, and arrays with duplicate keys.
If you think of a one dimensional array as going from
the lowest index on the left to the highest index on the right
then the parameters to this function are lowest index or
left and highest index or right. The first time you call
this function it will be with the parameters 0, a.length - 1.
Parameters: a - an integer array Parameters: lo0 - left boundary of array partition Parameters: hi0 - right boundary of array partition |
QuickSort | public void QuickSort(int a, int lo0, int hi0) throws Exception(Code) | | This is a generic version of C.A.R Hoare's Quick Sort
algorithm. This will handle arrays that are already
sorted, and arrays with duplicate keys.
If you think of a one dimensional array as going from
the lowest index on the left to the highest index on the right
then the parameters to this function are lowest index or
left and highest index or right. The first time you call
this function it will be with the parameters 0, a.length - 1.
Parameters: a - an integer array Parameters: lo0 - left boundary of array partition Parameters: hi0 - right boundary of array partition |
sort | public void sort(String a, Object[][] obj) throws Exception(Code) | | This method sorts the OID string array in ascending order.
Also it sorts multi array objects in "obj" according to the key
OID string array "a".
Parameters: a - the key string array to be sorted. Parameters: obj - the multiarray objects which are sorted according to thekey oid. |
|
|