Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.objexcel.util
Class Sorting

    java.lang.Object
      |
      +--com.objexcel.util.Sorting

public final class Sorting
extends java.lang.Object

Sorting implements the quickSort algortithm. It also provides comparers for different classes.

Inner Class Summary
`static class` | `Sorting.Comparer` the interface used to compare (for sorting /searching purposes a and b
`static class` | `Sorting.ObjectArrayComparer` adapts a comparer to expect an element at a given index of an array.
`static class` | `Sorting.ReverseComparer` reversing the order of the given comparer

Method Summary
`static int` | `binarySearch(java.lang.Object[] a, java.lang.Object key, Sorting.Comparer c)` find key in a according to c.
`static int` | `binarySearch(java.util.Vector a, java.lang.Object key, Sorting.Comparer c)` find key in a according to c.
`Sorting.Comparer` | `getComparer(java.lang.Class c)` get a comparer for the given class
`static Sorting` | `getInstance()` get the singleton instance of Sorting
`Sorting.Comparer` | `getReverseComparer(java.lang.Class c)` get the reverse order comparer for the given class
`void` | `registerComparer(java.lang.Class c, Sorting.Comparer comparer)` register your own comparer for a given class
`static void` | `sort(java.lang.Object[] v, Sorting.Comparer c)` sort v according to c
`static void` | `sort(java.util.Vector v, Sorting.Comparer c)` sort v according to c

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static Sorting getInstance()

  get the singleton instance of Sorting

### getComparer

    public Sorting.Comparer getComparer(java.lang.Class c)

  get a comparer for the given class

### getReverseComparer

    public Sorting.Comparer getReverseComparer(java.lang.Class c)

  get the reverse order comparer for the given class

### registerComparer

    public void registerComparer(java.lang.Class c,
                                 Sorting.Comparer comparer)

  register your own comparer for a given class

### sort

    public static void sort(java.util.Vector v,
                            Sorting.Comparer c)

  sort v according to c

### sort

    public static void sort(java.lang.Object[] v,
                            Sorting.Comparer c)

  sort v according to c

### binarySearch

    public static int binarySearch(java.util.Vector a,
                                   java.lang.Object key,
                                   Sorting.Comparer c)

  find key in a according to c. -1 if not found

### binarySearch

    public static int binarySearch(java.lang.Object[] a,
                                   java.lang.Object key,
                                   Sorting.Comparer c)

  find key in a according to c. -1 if not found

Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD