Implements a total ordering on objects.