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

## swing.addon.util
Class Sorter

    java.lang.Object
      |
      +--swing.addon.util.Sorter

public final class Sorter
extends java.lang.Object

This class defines a bunch of static methods for efficiently sorting arrays of Strings or other objects. It also defines two interfaces that provide two different ways of comparing objects to be sorted.

Inner Class Summary
`static interface` | `Sorter.Comparable` This is an alternative interface that can be used to order objects.
`static interface` | `Sorter.Comparer` This interface defines the compare() method used to compare two objects.

Constructor Summary
`Sorter()`

Method Summary
`static void` | `sort(java.lang.Object[] a, int from, int to, boolean up, Sorter.Comparer c)` Sort a portion of an array of objects, using the comparison defined by the Comparer object c.
`static void` | `sort(java.lang.Object[] a, java.lang.Object[] b, int from, int to, boolean up, Sorter.Comparer c)` This is the main sort() routine.
`static void` | `sort(java.lang.Object[] a, Sorter.Comparer c)` Sort an array of arbitrary objects into ascending order, using the comparison defined by the Comparer object c
`static void` | `sort(Sorter.Comparable[] a)` Sort an array of Comparable objects into ascending order
`static void` | `sort(Sorter.Comparable[] a, int from, int to, boolean up)` Sort a portion of an array of Comparable objects.
`static void` | `sort(Sorter.Comparable[] a, java.lang.Object[] b, int from, int to, boolean up)` Sort a portion of array a of Comparable objects.
`static void` | `sort(java.lang.String[] a)` Sort an array of strings into ascending order, using the correct collation order for the default locale
`static void` | `sort(java.lang.String[] a, int from, int to, boolean up, boolean ignorecase)` Sort a portion of an array of strings, using the collation order of the default locale.
`static void` | `sort(java.lang.String[] a, int from, int to, boolean up, boolean ignorecase, java.util.Locale locale)` Sort a portion of an array of strings, using the collation order of the specified locale.
`static void` | `sortAscii(java.lang.String[] a)` Sort an array of ASCII strings into ascending order
`static void` | `sortAscii(java.lang.String[] a, int from, int to, boolean up)` Sort a portion of an array of ASCII strings into ascending or descending order, depending on the argument up
`static void` | `sortAsciiIgnoreCase(java.lang.String[] a)` Sort an array of ASCII strings into ascending order, ignoring case
`static void` | `sortAsciiIgnoreCase(java.lang.String[] a, int from, int to, boolean up)` Sort an portion of an array of ASCII strings, ignoring case.

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

Constructor Detail

### Sorter

    public Sorter()

Method Detail

### sort

    public static void sort(java.lang.String[] a)

  Sort an array of strings into ascending order, using the correct collation order for the default locale

### sort

    public static void sort(Sorter.Comparable[] a)

  Sort an array of Comparable objects into ascending order

### sort

    public static void sort(java.lang.Object[] a,
                            Sorter.Comparer c)

  Sort an array of arbitrary objects into ascending order, using the comparison defined by the Comparer object c

### sort

    public static void sort(Sorter.Comparable[] a,
                            int from,
                            int to,
                            boolean up)

  Sort a portion of an array of Comparable objects. If up is true, sort into ascending order, otherwise sort into descending order.

### sort

    public static void sort(Sorter.Comparable[] a,
                            java.lang.Object[] b,
                            int from,
                            int to,
                            boolean up)

  Sort a portion of array a of Comparable objects. If up is true, sort into ascending order, otherwise sort into descending order. Re-arrange the array b in exactly the same way as a.

### sort

    public static void sort(java.lang.Object[] a,
                            int from,
                            int to,
                            boolean up,
                            Sorter.Comparer c)

  Sort a portion of an array of objects, using the comparison defined by the Comparer object c. If up is true, sort into ascending order, otherwise sort into descending order.

### sort

    public static void sort(java.lang.String[] a,
                            int from,
                            int to,
                            boolean up,
                            boolean ignorecase)

  Sort a portion of an array of strings, using the collation order of the default locale. If up is true, sort ascending, otherwise, sort descending. If ignorecase is true, ignore the capitalization of letters

### sort

    public static void sort(java.lang.Object[] a,
                            java.lang.Object[] b,
                            int from,
                            int to,
                            boolean up,
                            Sorter.Comparer c)

  This is the main sort() routine. It performs a quicksort on the elements of array a between the element from and the element to. The up argument specifies whether the elements should be sorted into ascending (true) or descending (false) order. The Comparer argument c is used to perform comparisons between elements of the array. The elements of the array b are reordered in exactly the same way as the elements of array a are.

### sort

    public static void sort(java.lang.String[] a,
                            int from,
                            int to,
                            boolean up,
                            boolean ignorecase,
                            java.util.Locale locale)

  Sort a portion of an array of strings, using the collation order of the specified locale. If up is true, sort ascending, otherwise, sort descending. If ignorecase is true, ignore the capitalization of letters

### sortAscii

    public static void sortAscii(java.lang.String[] a)

  Sort an array of ASCII strings into ascending order

### sortAscii

    public static void sortAscii(java.lang.String[] a,
                                 int from,
                                 int to,
                                 boolean up)

  Sort a portion of an array of ASCII strings into ascending or descending order, depending on the argument up

### sortAsciiIgnoreCase

    public static void sortAsciiIgnoreCase(java.lang.String[] a)

  Sort an array of ASCII strings into ascending order, ignoring case

### sortAsciiIgnoreCase

    public static void sortAsciiIgnoreCase(java.lang.String[] a,
                                           int from,
                                           int to,
                                           boolean up)

  Sort an portion of an array of ASCII strings, ignoring case. Sort into ascending order if up is true, otherwise sort into descending order.

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