Implemented the compareTo method to compare the current domain (this)
with another domain (d). If this < d, return -1. If this > d, return 1.
If this == d, return 0.