ComparableComparator (Spring Framework 3.2.1.RELEASE API)
Date: 2013-01-24

org.springframework.util.comparator

## Class ComparableComparator<T extends Comparable<T>>

- java.lang.Object
- - org.springframework.util.comparator.ComparableComparator<T>

- All Implemented Interfaces:
    Comparator<T>

      public class ComparableComparator<T extends Comparable<T>>
      extends Object
      implements Comparator<T>

  Comparator that adapts Comparables to the Comparator interface. Mainly for internal use in other Comparators, when supposed to work on Comparables.
  Since:
    1.2.2
  Author:
    Keith Donald
  See Also:
    `Comparable`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ComparableComparator` | `INSTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ComparableComparator()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(T o1, T 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

    - #### INSTANCE

          public static final ComparableComparator INSTANCE

  - ### Constructor Detail

    - #### ComparableComparator

          public ComparableComparator()

  - ### Method Detail

    - #### compare

          public int compare(T o1,
                    T o2)

      Specified by:
        `compare` in interface `Comparator<T extends Comparable<T>>`