I'm trying to do something like this, but Java won't let me. I suspect that I am just doing something wrong, but I really have no idea what.
public interface PopulationMember extends Comparable<T extends PopulationMember> {
int compareTo(T o);
T merge(T o);
// Some other stuff
}
It seems to think that T should be a class, not a generic type. My question is similar to this one, but not exactly the same thing. The point of all that is I want to have a type where I can compare it to other things of the same sub-type without being able to compare them to any other PopulationMember object.