First off, if you are going to write a compareTo() method in your class, then you may as well declare to the world that instances of your class can now be used wherever a Comparable<State> is expected. You do that by declaring that your class
implements Comparable<State>
Now, as far as implementing a useful compareTo() method for your class, primitives (int, double, etc.) have no methods. You can not do something like this:
However the (<, >, <=, >=, ==) operators are defined for ints so you can do this.
so in your compareTo() method, when comparing primitives
you should do something similar.
[ February 18, 2007: Message edited by: Garrett Rowe ]