# compare method

1. @override

int compare(

1. S a,
2. S b

)
override

Compares two values of type `T` for order.

Returns:

- A negative number if `a < b`
- `0` if `a == b`
- A positive number if `a > b`

This method must be implemented by subclasses or factory constructors.

## Implementation

    @override
    int compare(S a, S b) {
      T c1 = _converter.convert(a);
      T c2 = _converter.convert(b);
      return _comparator.compare(c1, c2);
    }