Sorter (JUnit API)
Date: 2011-08-22

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

## org.junit.runner.manipulation
Class Sorter

    java.lang.Object
      org.junit.runner.manipulation.Sorter

All Implemented Interfaces:
  Comparator<Description>

    public class Sorter

extends Object
implements Comparator<Description>

A `Sorter` orders tests. In general you will not need to use a `Sorter` directly. Instead, use `Request.sortWith(Comparator)`.

Field Summary
`static Sorter` | `NULL` NULL is a `Sorter` that leaves elements in an undefined order

Constructor Summary
`Sorter(Comparator<Description> comparator)` Creates a `Sorter` that uses `comparator` to sort tests

Method Summary
`void` | `apply(Object object)` Sorts the test in `runner` using `comparator`
`int` | `compare(Description o1, Description o2)`

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

Methods inherited from interface java.util.Comparator
`equals`

Field Detail

### NULL

    public static Sorter NULL

  NULL is a `Sorter` that leaves elements in an undefined order

Constructor Detail

### Sorter

    public Sorter(Comparator<Description> comparator)

  Creates a `Sorter` that uses `comparator` to sort tests

  Parameters:
    `comparator` - the `Comparator` to use when sorting tests

Method Detail

### apply

    public void apply(Object object)

  Sorts the test in `runner` using `comparator`

  Parameters:
    `object` -

### compare

    public int compare(Description o1,
                       Description o2)

  Specified by:
    `compare` in interface `Comparator<Description>`

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