# compareTo method

1. @override

int compareTo(

1. Object other

)
override

Allows this comparator to be compared with other objects.

This implementation enables the comparator to be used in sorted collections or other comparison contexts.

### Parameters:

- `other`: The object to compare this comparator to

### Returns:

Standard comparison result following the same rules as compare

## Implementation

    @override
    int compareTo(Object other) => _comparator?.compare(this, other) ?? compare(this, other);